Date: Sun, 27 Nov 2016 20:16:55 -0500 From: Ryan Stone <rysto32@gmail.com> To: Baptiste Daroussin <bapt@freebsd.org> Cc: "src-committers@freebsd.org" <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org> Subject: Re: svn commit: r309194 - head/usr.sbin/syslogd Message-ID: <CAFMmRNygK2JsqDmqRZhOtiCdxsCdBfVnbMP8cng3tM-30zkhBg@mail.gmail.com> In-Reply-To: <201611261550.uAQFo0HC074016@repo.freebsd.org> References: <201611261550.uAQFo0HC074016@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Nov 26, 2016 at 10:50 AM, Baptiste Daroussin <bapt@freebsd.org> wrote: > Author: bapt > Date: Sat Nov 26 15:49:59 2016 > New Revision: 309194 > URL: https://svnweb.freebsd.org/changeset/base/309194 > > Log: > initialize *nextp which could be left uninitialized in case the > configuration > file cannot be open/read > > Reported by: Coverity via cem > MFC after: 2 days > CID: 1365665 > > Modified: > head/usr.sbin/syslogd/syslogd.c > > Modified: head/usr.sbin/syslogd/syslogd.c > ============================================================ > ================== > --- head/usr.sbin/syslogd/syslogd.c Sat Nov 26 15:01:35 2016 > (r309193) > +++ head/usr.sbin/syslogd/syslogd.c Sat Nov 26 15:49:59 2016 > (r309194) > @@ -1835,6 +1835,7 @@ init(int signo) > free((char *)f); > } > Files = NULL; > + *nextp = NULL; > > /* open the configuration file */ > if ((cf = fopen(ConfFile, "r")) == NULL) { > > There is something very wrong in the code here. nextp is never initialized, so obviously we can't access *nextp. I'm surprised that this code can even compile with -Werror. I'd fix it but it'd not clear to me what nextp is intended to do.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFMmRNygK2JsqDmqRZhOtiCdxsCdBfVnbMP8cng3tM-30zkhBg>