mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
hw/9pfs: Initialize rest of qid field to zero.
Since qid is allocated out of stack we need to intialize the field to zero. Otherwise we will send wrong qid value to client. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
This commit is contained in:
parent
407fee0f02
commit
25427ec143
1 changed files with 1 additions and 0 deletions
|
@ -543,6 +543,7 @@ static void stat_to_qid(const struct stat *stbuf, V9fsQID *qidp)
|
|||
{
|
||||
size_t size;
|
||||
|
||||
memset(&qidp->path, 0, sizeof(qidp->path));
|
||||
size = MIN(sizeof(stbuf->st_ino), sizeof(qidp->path));
|
||||
memcpy(&qidp->path, &stbuf->st_ino, size);
|
||||
qidp->version = stbuf->st_mtime ^ (stbuf->st_size << 8);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue