mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
scd: Fix segfault changing key attr.
* asc/app-openpgp.c (change_keyattr_from_string): Release after allocated. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
dafce6f698
commit
693e657ff0
@ -2987,7 +2987,6 @@ change_keyattr_from_string (app_t app,
|
|||||||
size_t oid_len;
|
size_t oid_len;
|
||||||
|
|
||||||
oidstr = openpgp_curve_to_oid (string+n, NULL);
|
oidstr = openpgp_curve_to_oid (string+n, NULL);
|
||||||
gcry_mpi_release (oid);
|
|
||||||
if (!oidstr)
|
if (!oidstr)
|
||||||
{
|
{
|
||||||
err = gpg_error (GPG_ERR_INV_DATA);
|
err = gpg_error (GPG_ERR_INV_DATA);
|
||||||
@ -3005,6 +3004,7 @@ change_keyattr_from_string (app_t app,
|
|||||||
string[0] = algo;
|
string[0] = algo;
|
||||||
memcpy (string+1, oidbuf+1, oid_len-1);
|
memcpy (string+1, oidbuf+1, oid_len-1);
|
||||||
err = change_keyattr (app, keyno, string, oid_len, pincb, pincb_arg);
|
err = change_keyattr (app, keyno, string, oid_len, pincb, pincb_arg);
|
||||||
|
gcry_mpi_release (oid);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
err = gpg_error (GPG_ERR_PUBKEY_ALGO);
|
err = gpg_error (GPG_ERR_PUBKEY_ALGO);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user