Module Name:    src
Committed By:   agc
Date:           Sun Jun  7 01:52:48 UTC 2009

Modified Files:
        src/crypto/external/bsd/netpgp/dist/src/lib: netpgp.c

Log Message:
Fix an core dump reported by Oliver Gould - if there is no file from which
to read packets to list, fail with a decent error message.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 \
    src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c:1.19 src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c:1.20
--- src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c:1.19	Sun May 31 23:26:20 2009
+++ src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c	Sun Jun  7 01:52:48 2009
@@ -34,7 +34,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: netpgp.c,v 1.19 2009/05/31 23:26:20 agc Exp $");
+__RCSID("$NetBSD: netpgp.c,v 1.20 2009/06/07 01:52:48 agc Exp $");
 #endif
 
 #include <sys/types.h>
@@ -607,6 +607,10 @@
 	char		*homedir;
 
 	io = netpgp->io;
+	if (f == NULL) {
+		(void) fprintf(io->errs, "No file containing packets\n");
+		return 0;
+	}
 	homedir = netpgp_getvar(netpgp, "homedir");
 	if (pubringname == NULL) {
 		(void) snprintf(ringname, sizeof(ringname),

Reply via email to