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:
parent
fdba05155c
commit
e0dce0e5dc
|
|
@ -597,7 +597,7 @@ static int find_entry(unsigned ino, char **buf, int type)
|
||||||
fprintf(stderr, "ss: failed to malloc buffer\n");
|
fprintf(stderr, "ss: failed to malloc buffer\n");
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
**buf = **new_buf;
|
*buf = *new_buf;
|
||||||
buf_len = new_buf_len;
|
buf_len = new_buf_len;
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue