summary refs log tree commit diff stats
path: root/chardev/char-stdio.c
diff options
context:
space:
mode:
authorKeno Fischer <keno@juliacomputing.com>2018-06-07 12:17:22 +0200
committerGreg Kurz <groug@kaod.org>2018-06-07 12:17:22 +0200
commita647502c582981c395b5d16e52a22ac7aff0fb2b (patch)
tree0c523ce85c17bf164dba25bd35beef05e95a1b9f /chardev/char-stdio.c
parentec70b956fddf628ee2e42521c54362e80115a3c4 (diff)
downloadfocaccia-qemu-a647502c582981c395b5d16e52a22ac7aff0fb2b.tar.gz
focaccia-qemu-a647502c582981c395b5d16e52a22ac7aff0fb2b.zip
9p: xattr: Fix crashes due to free of uninitialized value
If the size returned from llistxattr/lgetxattr is 0, we skipped
the malloc call, leaving xattr.value uninitialized. However, this
value is later passed to `g_free` without any further checks,
causing an error. Fix that by always calling g_malloc unconditionally.
If `size` is 0, it will return NULL, which is safe to pass to g_free.

Signed-off-by: Keno Fischer <keno@juliacomputing.com>
Signed-off-by: Greg Kurz <groug@kaod.org>
Diffstat (limited to 'chardev/char-stdio.c')
0 files changed, 0 insertions, 0 deletions