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: NKeno Fischer <keno@juliacomputing.com> Signed-off-by: NGreg Kurz <groug@kaod.org>
Showing
想要评论请 注册 或 登录