un is declared as an automatic variable in main(), and isn't
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 18 Apr 1994 00:33:01 +0000 (16:33 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 18 Apr 1994 00:33:01 +0000 (16:33 -0800)
bzero'd before use.
From: "Chris G. Demetriou" <cgd@nobozo.CS.Berkeley.EDU>

SCCS-vsn: usr.sbin/lpr/common_source/startdaemon.c 8.2

usr/src/usr.sbin/lpr/common_source/startdaemon.c

index 7b6bc25..40ca7a2 100644 (file)
@@ -1,12 +1,12 @@
 /*
 /*
- * Copyright (c) 1983, 1993
+ * Copyright (c) 1983, 1993, 1994
  *     The Regents of the University of California.  All rights reserved.
  *
  * %sccs.include.redist.c%
  */
 
 #ifndef lint
  *     The Regents of the University of California.  All rights reserved.
  *
  * %sccs.include.redist.c%
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)startdaemon.c      8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)startdaemon.c      8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 
 #endif /* not lint */
 
 
@@ -41,6 +41,7 @@ startdaemon(printer)
                perr("socket");
                return(0);
        }
                perr("socket");
                return(0);
        }
+       memset(&un, 0, sizeof(un));
        un.sun_family = AF_UNIX;
        strcpy(un.sun_path, _PATH_SOCKETNAME);
 #ifndef SUN_LEN
        un.sun_family = AF_UNIX;
        strcpy(un.sun_path, _PATH_SOCKETNAME);
 #ifndef SUN_LEN