Source-Changes-HG archive

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

[src/trunk]: src/crypto/external/bsd/netpgp/dist/src/lib Check for a null key...



details:   https://anonhg.NetBSD.org/src/rev/a194da1a6364
branches:  trunk
changeset: 755337:a194da1a6364
user:      agc <agc%NetBSD.org@localhost>
date:      Wed Jun 02 03:38:01 2010 +0000

description:
Check for a null keyring before listing keys - with thanks to Jeff Rizzo
for the problem report.

diffstat:

 crypto/external/bsd/netpgp/dist/src/lib/netpgp.c |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r 45481a3afe50 -r a194da1a6364 crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c  Wed Jun 02 03:15:14 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c  Wed Jun 02 03:38:01 2010 +0000
@@ -34,7 +34,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: netpgp.c,v 1.57 2010/06/01 05:22:38 agc Exp $");
+__RCSID("$NetBSD: netpgp.c,v 1.58 2010/06/02 03:38:01 agc Exp $");
 #endif
 
 #include <sys/types.h>
@@ -561,6 +561,10 @@
 int
 netpgp_list_keys(netpgp_t *netpgp, const int psigs)
 {
+       if (netpgp->pubring == NULL) {
+               (void) fprintf(stderr, "No keyring\n");
+               return 0;
+       }
        return __ops_keyring_list(netpgp->io, netpgp->pubring, psigs);
 }
 



Home | Main Index | Thread Index | Old Index