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 cleanly fail initial...



details:   https://anonhg.NetBSD.org/src/rev/43e78537bacd
branches:  trunk
changeset: 746046:43e78537bacd
user:      jhigh <jhigh%NetBSD.org@localhost>
date:      Sat Mar 21 01:07:21 2020 +0000

description:
cleanly fail initialization on empty keyring

diffstat:

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

diffs (21 lines):

diff -r 139ba265ee3b -r 43e78537bacd crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c  Fri Mar 20 23:09:01 2020 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c  Sat Mar 21 01:07:21 2020 +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.102 2018/11/13 14:52:30 mlelstv Exp $");
+__RCSID("$NetBSD: netpgp.c,v 1.103 2020/03/21 01:07:21 jhigh Exp $");
 #endif
 
 #include <sys/types.h>
@@ -429,7 +429,7 @@
        int      i;
        int      n;
 
-       if (ring == NULL) {
+       if (ring == NULL || ring->keyc == 0) {
                return 0;
        }
        (void) memset(id, 0x0, len);



Home | Main Index | Thread Index | Old Index