Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/lpr/common_source in ckqueue() if "sd" is not an ex...



details:   https://anonhg.NetBSD.org/src/rev/651e5cbdd22f
branches:  trunk
changeset: 587270:651e5cbdd22f
user:      garbled <garbled%NetBSD.org@localhost>
date:      Tue Jan 17 18:38:12 2006 +0000

description:
in ckqueue() if "sd" is not an existing capability, than sd will be
uninitialized, causing the free() in out: to explode.  Initialize sd to NULL.

diffstat:

 usr.sbin/lpr/common_source/common.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 0098c681e586 -r 651e5cbdd22f usr.sbin/lpr/common_source/common.c
--- a/usr.sbin/lpr/common_source/common.c       Tue Jan 17 17:29:28 2006 +0000
+++ b/usr.sbin/lpr/common_source/common.c       Tue Jan 17 18:38:12 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: common.c,v 1.29 2006/01/04 15:32:50 garbled Exp $      */
+/*     $NetBSD: common.c,v 1.30 2006/01/17 18:38:12 garbled Exp $      */
 
 /*
  * Copyright (c) 1983, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)common.c   8.5 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: common.c,v 1.29 2006/01/04 15:32:50 garbled Exp $");
+__RCSID("$NetBSD: common.c,v 1.30 2006/01/17 18:38:12 garbled Exp $");
 #endif
 #endif /* not lint */
 
@@ -439,7 +439,7 @@
        struct dirent *d;
        DIR *dirp;
        const char *spooldir;
-       char *sd;
+       char *sd = NULL;
        int rv = 0;
 
        spooldir = cgetstr(cap, "sd", &sd) == -1 ? _PATH_DEFSPOOL : sd;



Home | Main Index | Thread Index | Old Index