svn commit: r309194 - head/usr.sbin/syslogd

Ryan Stone rysto32 at gmail.com
Mon Nov 28 01:16:56 UTC 2016


On Sat, Nov 26, 2016 at 10:50 AM, Baptiste Daroussin <bapt at 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.


More information about the svn-src-head mailing list