Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Nov 2017 19:18:01 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326338 - head/usr.sbin/syslogd
Message-ID:  <201711281918.vASJI1bb034160@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Tue Nov 28 19:18:00 2017
New Revision: 326338
URL: https://svnweb.freebsd.org/changeset/base/326338

Log:
  Fix obvious NULL pointer dereference from r310350.

Modified:
  head/usr.sbin/syslogd/syslogd.c

Modified: head/usr.sbin/syslogd/syslogd.c
==============================================================================
--- head/usr.sbin/syslogd/syslogd.c	Tue Nov 28 19:09:05 2017	(r326337)
+++ head/usr.sbin/syslogd/syslogd.c	Tue Nov 28 19:18:00 2017	(r326338)
@@ -792,14 +792,13 @@ socklist_recv_sock(struct socklist *sl)
 	} else {
 		hname = cvthname(sa);
 		unmapped(sa);
-		if (validate(sa, hname) == 0)
-			hname = NULL;
+		if (validate(sa, hname) == 0) {
+			dprintf("Message from %s was ignored.", hname);
+			return (-1);
+		}
 		date = RemoteAddDate ? ADDDATE : 0;
 	}
-	if (hname != NULL)
-		printline(hname, line, date);
-	else
-		dprintf("Invalid msg from %s was ignored.", hname);
+	printline(hname, line, date);
 
 	return (0);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711281918.vASJI1bb034160>