backtrace: Avoid null-dereferencing strchr result
This commit is contained in:
parent
fa9ae4acb7
commit
f0d811b79c
|
@ -121,6 +121,9 @@ void __iwd_backtrace_print(unsigned int offset)
|
||||||
buf[len] = '\0';
|
buf[len] = '\0';
|
||||||
|
|
||||||
pos = strchr(buf, '\n');
|
pos = strchr(buf, '\n');
|
||||||
|
if (!pos)
|
||||||
|
continue;
|
||||||
|
|
||||||
*pos++ = '\0';
|
*pos++ = '\0';
|
||||||
|
|
||||||
if (strcmp(buf, "??") == 0) {
|
if (strcmp(buf, "??") == 0) {
|
||||||
|
|
Loading…
Reference in New Issue