Fix *xattr decoding

* file.c (print_xattr_val): Do not attempt to decode a zero sized array.
Fixes RH#885233.
This commit is contained in:
Дмитрий Левин 2012-12-07 21:38:52 +00:00
parent eff5c0e60c
commit 1f21513c38

2
file.c
View File

@ -2466,6 +2466,8 @@ print_xattr_val(struct tcb *tcp, int failed,
unsigned long insize,
unsigned long size)
{
if (insize == 0)
failed = 1;
if (!failed) {
unsigned long capacity = 4 * size + 1;
unsigned char *buf = (capacity < size) ? NULL : malloc(capacity);