aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal H. Walfield <[email protected]>2015-03-31 12:48:31 +0000
committerNeal H. Walfield <[email protected]>2015-03-31 12:48:31 +0000
commitd0ff2ee04187fbedacbe4d3884ee75d957a0b8c6 (patch)
treedcc983814d182abe60660d72886250b616ded80a
parentdirmngr: Simplify truncation of long strings in debug code. (diff)
downloadgnupg-d0ff2ee04187fbedacbe4d3884ee75d957a0b8c6.tar.gz
gnupg-d0ff2ee04187fbedacbe4d3884ee75d957a0b8c6.zip
dirmngr: Don't use alloca.
* dirmngr/ks-engine-ldap.c (ks_ldap_put): Replace use of alloca with xmalloc and xfree. -- Signed-off-by: Neal H. Walfield <[email protected]>
-rw-r--r--dirmngr/ks-engine-ldap.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/dirmngr/ks-engine-ldap.c b/dirmngr/ks-engine-ldap.c
index 66e496409..1ce709d5e 100644
--- a/dirmngr/ks-engine-ldap.c
+++ b/dirmngr/ks-engine-ldap.c
@@ -1961,7 +1961,7 @@ ks_ldap_put (ctrl_t ctrl, parsed_uri_t uri,
/* The last line is not \n terminated! Make a copy so we can
add a NUL terminator. */
{
- temp = alloca (infolen + 1);
+ temp = xmalloc (infolen + 1);
memcpy (temp, info, infolen);
info = temp;
newline = (char *) info + infolen;
@@ -1978,7 +1978,10 @@ ks_ldap_put (ctrl_t ctrl, parsed_uri_t uri,
if (! temp)
assert ((char *) info + infolen - 1 == infoend);
else
- assert (infolen == -1);
+ {
+ assert (infolen == -1);
+ xfree (temp);
+ }
}
modlist_add (&addlist, "objectClass", "pgpKeyInfo");