mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-07 16:12:51 +00:00
vfs: zero-initialize struct stat in *_stat and *_fstat handlers
...otherwise some fields will contain garbage values. This wasn't noticed until HAVE_BLKSIZE got enabled in newlib builds.
This commit is contained in:
@@ -207,6 +207,7 @@ static ssize_t tusb_read(int fd, void *data, size_t size)
|
||||
static int tusb_fstat(int fd, struct stat *st)
|
||||
{
|
||||
FD_CHECK(fd, -1);
|
||||
memset(st, 0, sizeof(*st));
|
||||
st->st_mode = S_IFCHR;
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user