diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2004-12-03 14:20:01 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2004-12-03 14:20:01 +0000 |
commit | d8296f893da4f7bc4f259caed2edcdaaf0479cf7 (patch) | |
tree | a9edaea233379cc8a5cc070977e6ea8bc22ab09d /src | |
parent | f9812176b43128c68637604bc9e0d39bbf83ad52 (diff) | |
download | anubis-d8296f893da4f7bc4f259caed2edcdaaf0479cf7.tar.gz anubis-d8296f893da4f7bc4f259caed2edcdaaf0479cf7.tar.bz2 |
(create_key_array): Dynamically allocate current_key.
Diffstat (limited to 'src')
-rw-r--r-- | src/gpg.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -208,10 +208,10 @@ static gpgme_key_t * create_key_array(gpgme_ctx_t ctx, struct obstack *stk) { gpgme_key_t tmpkey; - char current_key[100]; + char *current_key; int i, j, len = strlen (gpg.encryption_keys); - memset (current_key, 0, sizeof (current_key)); + current_key = xmalloc (len+1); for (i = j = 0; i <= len; i++) { if (gpg.encryption_keys[i] == ',' || gpg.encryption_keys[i] == '\0') @@ -249,7 +249,7 @@ create_key_array(gpgme_ctx_t ctx, struct obstack *stk) else current_key[j++] = gpg.encryption_keys[i]; } - + xfree (current_key); tmpkey = NULL; obstack_grow (stk, &tmpkey, sizeof (tmpkey)); return obstack_finish (stk); |