avoid null pointer dereference
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Mon, 27 Mar 1995 05:50:18 +0000 (21:50 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Mon, 27 Mar 1995 05:50:18 +0000 (21:50 -0800)
SCCS-vsn: usr.sbin/sendmail/src/readcf.c 8.76

usr/src/usr.sbin/sendmail/src/readcf.c

index dd2f0ec..70412c0 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)readcf.c   8.75 (Berkeley) %G%";
+static char sccsid[] = "@(#)readcf.c   8.76 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -676,9 +676,10 @@ fileclass(class, filename, fmt, safe, optional)
        if (safe)
                sff |= SFF_OPENASROOT;
        f = safefopen(filename, O_RDONLY, 0, sff);
-       if (f == NULL && !optional)
+       if (f == NULL)
        {
-               syserr("fileclass: cannot open %s", filename);
+               if (!optional)
+                       syserr("fileclass: cannot open %s", filename);
                return;
        }