Blame SOURCES/dnsmasq-2.79-rh1602477-2.patch

2bab6f
From dcb4fa04548ab2364f662b735be86e275bd50745 Mon Sep 17 00:00:00 2001
2bab6f
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
2bab6f
Date: Fri, 19 Jul 2019 14:00:08 +0200
2bab6f
Subject: [PATCH] Remove warnings in coverity
2bab6f
2bab6f
Change in dnsmasq should never occur, because ent_pw would not change.
2bab6f
But keep Coverity happy and prevent logic error. Second change avoids
2bab6f
warning from compiler.
2bab6f
---
2bab6f
 src/dnsmasq.c | 9 ++++++++-
2bab6f
 src/option.c  | 2 +-
2bab6f
 2 files changed, 9 insertions(+), 2 deletions(-)
2bab6f
2bab6f
diff --git a/src/dnsmasq.c b/src/dnsmasq.c
2bab6f
index ce44809..2984f55 100644
2bab6f
--- a/src/dnsmasq.c
2bab6f
+++ b/src/dnsmasq.c
2bab6f
@@ -608,7 +608,14 @@ int main (int argc, char **argv)
2bab6f
   
2bab6f
       if (ent_pw && ent_pw->pw_uid != 0)
2bab6f
 	{     
2bab6f
-#if defined(HAVE_LINUX_NETWORK)	  
2bab6f
+#if defined(HAVE_LINUX_NETWORK)
2bab6f
+	  if (!hdr || !data)
2bab6f
+	    {
2bab6f
+	      /* Just failsafe for logic errors */
2bab6f
+	      send_event(err_pipe[1], EVENT_CAP_ERR, ENOMEM, NULL);
2bab6f
+	      _exit(0);
2bab6f
+	    }
2bab6f
+
2bab6f
 	  /* On linux, we keep CAP_NETADMIN (for ARP-injection) and
2bab6f
 	     CAP_NET_RAW (for icmp) if we're doing dhcp. If we have yet to bind 
2bab6f
 	     ports because of DAD, or we're doing it dynamically,
2bab6f
diff --git a/src/option.c b/src/option.c
2bab6f
index 9768efb..b12183b 100644
2bab6f
--- a/src/option.c
2bab6f
+++ b/src/option.c
2bab6f
@@ -4255,7 +4255,7 @@ err:
2bab6f
 		struct name_list *nl;
2bab6f
 		if (!canon)
2bab6f
                   {
2bab6f
-		    struct name_list *tmp = new->names, *next;
2bab6f
+		    struct name_list *tmp, *next;
2bab6f
 		    for (tmp = new->names; tmp; tmp = next)
2bab6f
 		      {
2bab6f
 			next = tmp->next;
2bab6f
-- 
2bab6f
2.20.1
2bab6f