backtrace: Avoid null-dereferencing strchr result

This commit is contained in:
Denis Kenzior 2021-02-09 10:30:48 -06:00
parent fa9ae4acb7
commit f0d811b79c
1 changed files with 3 additions and 0 deletions

View File

@ -121,6 +121,9 @@ void __iwd_backtrace_print(unsigned int offset)
buf[len] = '\0';
pos = strchr(buf, '\n');
if (!pos)
continue;
*pos++ = '\0';
if (strcmp(buf, "??") == 0) {