Remove null pointer dereference
This if is only true if both strchr return NULL, making sure that *q is a NULL dereference. The intention was to remove trailing '>' (or '\t') from the message-id (p) for add_news_message(). Adjust the condition.
This commit is contained in:
2
news.c
2
news.c
@@ -443,7 +443,7 @@ loadNewsgroup0(ParsedURL *pu)
|
|||||||
continue;
|
continue;
|
||||||
if (*p == '<')
|
if (*p == '<')
|
||||||
p++;
|
p++;
|
||||||
if (!(q = strchr(p, '>')) && !(q = strchr(p, '\t')))
|
if ((q = strchr(p, '>')) || (q = strchr(p, '\t')))
|
||||||
*q = '\0';
|
*q = '\0';
|
||||||
if (!(s = checkHeader(buf, "Subject:")))
|
if (!(s = checkHeader(buf, "Subject:")))
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user