fs/rpmsgfs: Zero dirs after realloc to avoid stale data
since many places assume the null pointer as an unused entry Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
d33f90b78c
commit
987b01221c
@ -285,6 +285,9 @@ static int rpmsgfs_attach_dir(FAR struct rpmsgfs_server_s *priv,
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
memset(&tmp[priv->dir_nums], 0, sizeof(FAR void *) *
|
||||
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK);
|
||||
|
||||
priv->dirs = tmp;
|
||||
priv->dir_nums += CONFIG_NFILE_DESCRIPTORS_PER_BLOCK;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user