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/5eda6a41f5c1
branches:  trunk
changeset: 849965:5eda6a41f5c1
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 a1fd8fdabfc0 -r 5eda6a41f5c1 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