From: gilles Date: Wed, 21 Jul 2010 14:45:59 +0000 (+0000) Subject: fix NULL-deref, ok martinh@ X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=5344c61fdcf992c939b35ca4212cf6c6de5ac59c;p=openbsd fix NULL-deref, ok martinh@ --- 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);