X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=g10%2Fgpgcompose.c;h=fafbfd274c5fc76b9834c0c9329099c9a3397851;hb=ebc2936d55f986e0176631bdf76674f31ad66c9e;hp=512cb450a92df99d5a1aec2b458c04c8fef34a80;hpb=ec7411146b283f9271f7d087bb7a58e2dba45fea;p=gnupg2.git diff --git a/g10/gpgcompose.c b/g10/gpgcompose.c index 512cb45..fafbfd2 100644 --- a/g10/gpgcompose.c +++ b/g10/gpgcompose.c @@ -1654,13 +1654,17 @@ mksubpkt_callback (PKT_signature *sig, void *cookie) if (si->reason_for_revocation) { - int l = 1 + strlen (si->reason_for_revocation); - char buf[l]; + int len = 1 + strlen (si->reason_for_revocation); + char *buf; + + buf = xmalloc (len); buf[0] = si->reason_for_revocation_code; - memcpy (&buf[1], si->reason_for_revocation, l - 1); + memcpy (&buf[1], si->reason_for_revocation, len - 1); + + build_sig_subpkt (sig, SIGSUBPKT_REVOC_REASON, buf, len); - build_sig_subpkt (sig, SIGSUBPKT_REVOC_REASON, buf, l); + xfree (buf); } if (si->features) @@ -2540,10 +2544,13 @@ encrypted (const char *option, int argc, char *argv[], void *cookie) if (do_debug) { - char buf[2 * session_key.keylen + 1]; + char *buf; + + buf = xmalloc (2 * session_key.keylen + 1); debug ("session key: algo: %d; keylen: %d; key: %s\n", session_key.algo, session_key.keylen, bin2hex (session_key.key, session_key.keylen, buf)); + xfree (buf); } if (strcmp (option, "--encrypted-mdc") == 0)