summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2010-07-21 14:46:00 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2010-07-21 14:46:00 +0000
commita8cc2333c19131d448d5e6c4515530f468af61b2 (patch)
treea7b4494e3e56516cae6631921134e4cbae843d16
parent9131a6ee5832d2c6f2b1e83160310041b9c09dcf (diff)
fix NULL-deref, ok martinh@
-rw-r--r--usr.sbin/ypldap/aldap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ypldap/aldap.c b/usr.sbin/ypldap/aldap.c
index f201cbc52bd..09a7b3df83e 100644
--- a/usr.sbin/ypldap/aldap.c
+++ b/usr.sbin/ypldap/aldap.c
@@ -1,5 +1,5 @@
-/* $Id: aldap.c,v 1.24 2010/06/14 13:15:22 pyr Exp $ */
-/* $OpenBSD: aldap.c,v 1.24 2010/06/14 13:15:22 pyr Exp $ */
+/* $Id: aldap.c,v 1.25 2010/07/21 14:45:59 gilles Exp $ */
+/* $OpenBSD: aldap.c,v 1.25 2010/07/21 14:45:59 gilles Exp $ */
/*
* Copyright (c) 2008 Alexander Schrijver <aschrijver@openbsd.org>
@@ -603,7 +603,7 @@ aldap_get_stringset(struct ber_element *elm)
if ((ret = calloc(i + 1, sizeof(char *))) == NULL)
return NULL;
- for (a = elm, i = 0; a->be_type == BER_TYPE_OCTETSTRING;
+ for (a = elm, i = 0; a != NULL && a->be_type == BER_TYPE_OCTETSTRING;
a = a->be_next, i++) {
ber_get_string(a, &s);