Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: ltc: fix double free in dsa_import() #1963

Merged
merged 1 commit into from
Nov 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion core/lib/libtomcrypt/src/pk/dsa/dsa_import.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,12 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key)
PKA_DSA, tmpbuf, &tmpbuf_len,
LTC_ASN1_SEQUENCE, params, 3);
if (err != CRYPT_OK) {
XFREE(tmpbuf);
goto LBL_ERR;
}

if ((err=der_decode_integer(tmpbuf, tmpbuf_len, key->y)) != CRYPT_OK) {
XFREE(tmpbuf);
goto LBL_ERR;
}

Expand All @@ -152,7 +154,6 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key)

return CRYPT_OK;
LBL_ERR:
XFREE(tmpbuf);
mp_clear_multi(key->p, key->g, key->q, key->x, key->y, NULL);
return err;
}
Expand Down