mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
agent: Avoid uninitialized access in GENKEY command on parameter error.
* agent/command.c (cmd_genkey): Moved init_membuf to the top. -- Signed-off-by: Jakub Jelen <jjelen@redhat.com> This is part of GnuPG-bug-id: 7129
This commit is contained in:
parent
bdbf5cee2f
commit
379fc5569d
1 changed files with 2 additions and 2 deletions
|
@ -1170,6 +1170,8 @@ cmd_genkey (assuan_context_t ctx, char *line)
|
||||||
int c;
|
int c;
|
||||||
unsigned int flags = 0;
|
unsigned int flags = 0;
|
||||||
|
|
||||||
|
init_membuf (&outbuf, 512);
|
||||||
|
|
||||||
if (ctrl->restricted)
|
if (ctrl->restricted)
|
||||||
return leave_cmd (ctx, gpg_error (GPG_ERR_FORBIDDEN));
|
return leave_cmd (ctx, gpg_error (GPG_ERR_FORBIDDEN));
|
||||||
|
|
||||||
|
@ -1227,8 +1229,6 @@ cmd_genkey (assuan_context_t ctx, char *line)
|
||||||
if (rc)
|
if (rc)
|
||||||
goto leave;
|
goto leave;
|
||||||
|
|
||||||
init_membuf (&outbuf, 512);
|
|
||||||
|
|
||||||
/* If requested, ask for the password to be used for the key. If
|
/* If requested, ask for the password to be used for the key. If
|
||||||
this is not used the regular Pinentry mechanism is used. */
|
this is not used the regular Pinentry mechanism is used. */
|
||||||
if (opt_inq_passwd && !(flags & GENKEY_FLAG_NO_PROTECTION))
|
if (opt_inq_passwd && !(flags & GENKEY_FLAG_NO_PROTECTION))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue