misc/ss: avoid NULL pointer dereference

This was working before, but only if realloc a) succeeded and b) did not
move the buffer to a different location. ''**buf = **new_buf' then
writes the value of *new_buf's first field into that of *buf.

Signed-off-by: Phil Sutter <phil@nwl.cc>
This commit is contained in:
Phil Sutter 2015-08-06 14:24:32 +02:00 committed by Stephen Hemminger
parent fdba05155c
commit e0dce0e5dc
1 changed files with 1 additions and 1 deletions

View File

@ -597,7 +597,7 @@ static int find_entry(unsigned ino, char **buf, int type)
fprintf(stderr, "ss: failed to malloc buffer\n");
abort();
}
**buf = **new_buf;
*buf = *new_buf;
buf_len = new_buf_len;
continue;
} else {