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 PR/42435 : Check poi...
details: https://anonhg.NetBSD.org/src/rev/21e683cd563b
branches: trunk
changeset: 758299:21e683cd563b
user: stacktic <stacktic%NetBSD.org@localhost>
date: Sun Oct 31 19:45:53 2010 +0000
description:
PR/42435 : Check pointers against NULL to avoid dereferencing them
diffstat:
crypto/external/bsd/netpgp/dist/src/lib/keyring.c | 4 ++--
crypto/external/bsd/netpgp/dist/src/lib/netpgp.c | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
diffs (42 lines):
diff -r 44584671c131 -r 21e683cd563b crypto/external/bsd/netpgp/dist/src/lib/keyring.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/keyring.c Sun Oct 31 18:31:03 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/keyring.c Sun Oct 31 19:45:53 2010 +0000
@@ -57,7 +57,7 @@
#if defined(__NetBSD__)
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: keyring.c,v 1.46 2010/09/01 17:25:57 agc Exp $");
+__RCSID("$NetBSD: keyring.c,v 1.47 2010/10/31 19:45:53 stacktic Exp $");
#endif
#ifdef HAVE_FCNTL_H
@@ -902,7 +902,7 @@
uint8_t keyid[OPS_KEY_ID_SIZE + 1];
size_t len;
- if (!keyring) {
+ if (!keyring || !name || !from) {
return NULL;
}
len = strlen(name);
diff -r 44584671c131 -r 21e683cd563b crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c Sun Oct 31 18:31:03 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c Sun Oct 31 19:45:53 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.77 2010/10/19 00:00:00 agc Exp $");
+__RCSID("$NetBSD: netpgp.c,v 1.78 2010/10/31 19:45:53 stacktic Exp $");
#endif
#include <sys/types.h>
@@ -423,6 +423,8 @@
if (userid == NULL) {
userid = netpgp_getvar(netpgp, "userid");
+ if (userid == NULL)
+ return NULL;
} else if (userid[0] == '0' && userid[1] == 'x') {
userid += 2;
}
Home |
Main Index |
Thread Index |
Old Index