[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-commits-all
Subject:    Re: svn commit: r309194 - head/usr.sbin/syslogd
From:       Ryan Stone <rysto32 () gmail ! com>
Date:       2016-11-28 1:16:55
Message-ID: CAFMmRNygK2JsqDmqRZhOtiCdxsCdBfVnbMP8cng3tM-30zkhBg () mail ! gmail ! com
[Download RAW message or body]

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.
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic