From 5344c61fdcf992c939b35ca4212cf6c6de5ac59c Mon Sep 17 00:00:00 2001 From: gilles Date: Wed, 21 Jul 2010 14:45:59 +0000 Subject: [PATCH] fix NULL-deref, ok martinh@ --- usr.sbin/ypldap/aldap.c | 6 +++--- 1 file 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 @@ -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); -- 2.20.1