From 22d1fb47ac911700090346c445a1429ea02f8d34 Mon Sep 17 00:00:00 2001 From: Rene Kita Date: Tue, 28 Dec 2021 14:25:19 +0100 Subject: [PATCH] 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. --- news.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news.c b/news.c index cd76c26..7791cde 100644 --- a/news.c +++ b/news.c @@ -443,7 +443,7 @@ loadNewsgroup0(ParsedURL *pu) continue; if (*p == '<') p++; - if (!(q = strchr(p, '>')) && !(q = strchr(p, '\t'))) + if ((q = strchr(p, '>')) || (q = strchr(p, '\t'))) *q = '\0'; if (!(s = checkHeader(buf, "Subject:"))) continue;