Skip to content

Commit

Permalink
digsig: Fix memory leakage in digsig_verify_rsa()
Browse files Browse the repository at this point in the history
digsig_verify_rsa() does not free kmalloc'ed buffer returned by
mpi_get_buffer().

Signed-off-by: YOSHIFUJI Hideaki <[email protected]>
Signed-off-by: Dmitry Kasatkin <[email protected]>
Cc: [email protected]
Signed-off-by: James Morris <[email protected]>
  • Loading branch information
yoshfuji authored and James Morris committed Feb 1, 2013
1 parent 88b62b9 commit 7810cc1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/digsig.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ static int digsig_verify_rsa(struct key *key,
memset(out1, 0, head);
memcpy(out1 + head, p, l);

kfree(p);

err = pkcs_1_v1_5_decode_emsa(out1, len, mblen, out2, &len);
if (err)
goto err;
Expand Down

0 comments on commit 7810cc1

Please sign in to comment.