1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

agent: Fix KEYTOCARD for the use case with loopback pinentry.

* agent/command.c (cmd_keytocard): Copy LINE.

--

GnuPG-bug-id: 7283
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2024-09-03 14:06:48 +09:00 committed by Werner Koch
parent 1ea66b6df3
commit 5a1bf7e552
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -3251,6 +3251,12 @@ cmd_keytocard (assuan_context_t ctx, char *line)
force = has_option (line, "--force");
line = skip_options (line);
/* Need a copy of LINE, since it might inquire to the frontend which
resulted original buffer overwritten. */
line = xtrystrdup (line);
if (!line)
return gpg_error_from_syserror ();
argc = split_fields (line, argv, DIM (argv));
if (argc < 3)
{
@ -3370,6 +3376,7 @@ cmd_keytocard (assuan_context_t ctx, char *line)
xfree (keydata);
leave:
xfree (line);
xfree (ecdh_params);
gcry_sexp_release (s_skey);
xfree (shadow_info);