From ffa9994f58a7c06a92b27fd29d027e9e6a1025d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sun, 23 May 2004 21:17:27 +0000 Subject: [PATCH] (LDAP_message2entry): in the sambaNTPassword case, make sure ent->etypes are allocated, From: Andrew Bartlett git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13854 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hdb/hdb-ldap.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/hdb/hdb-ldap.c b/lib/hdb/hdb-ldap.c index 701bfec58..159637624 100644 --- a/lib/hdb/hdb-ldap.c +++ b/lib/hdb/hdb-ldap.c @@ -1002,6 +1002,17 @@ LDAP_message2entry(krb5_context context, HDB * db, LDAPMessage * msg, ent->keys.len++; + if (ent->etypes == NULL) { + ent->etypes = malloc(sizeof(*(ent->etypes))); + if (ent->etypes == NULL) { + krb5_set_error_string(context, "malloc: out of memory"); + ret = ENOMEM; + goto out; + } + ent->etypes->val = NULL; + ent->etypes->len = 0; + } + etypes = realloc(ent->etypes->val, (ent->etypes->len + 1) * sizeof(ent->etypes->val[0])); if (etypes == NULL) {