From owner-svn-src-head@freebsd.org Tue Nov 28 19:18:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3ACBCDEBE98; Tue, 28 Nov 2017 19:18:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07BB07447F; Tue, 28 Nov 2017 19:18:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vASJI1IJ034161; Tue, 28 Nov 2017 19:18:01 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vASJI1bb034160; Tue, 28 Nov 2017 19:18:01 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201711281918.vASJI1bb034160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 28 Nov 2017 19:18:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326338 - head/usr.sbin/syslogd X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/usr.sbin/syslogd X-SVN-Commit-Revision: 326338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Nov 2017 19:18:02 -0000 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); }