Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 287113
b: refs/heads/master
c: f58a081
h: refs/heads/master
i:
  287111: e442254
v: v3
  • Loading branch information
Dmitry Kasatkin authored and James Morris committed Feb 1, 2012
1 parent c271724 commit 7531c00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bc95eeadf5c6fd9e9840898a83a93718a0114b6d
refs/heads/master: f58a08152ce4198a2a1da162b97ecf8264c24866
9 changes: 7 additions & 2 deletions trunk/lib/digsig.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ static int digsig_verify_rsa(struct key *key,

down_read(&key->sem);
ukp = key->payload.data;

if (ukp->datalen < sizeof(*pkh))
goto err1;

pkh = (struct pubkey_hdr *)ukp->data;

if (pkh->version != 1)
Expand All @@ -117,7 +121,7 @@ static int digsig_verify_rsa(struct key *key,
goto err1;

datap = pkh->mpi;
endp = datap + ukp->datalen;
endp = ukp->data + ukp->datalen;

for (i = 0; i < pkh->nmpi; i++) {
unsigned int remaining = endp - datap;
Expand All @@ -128,7 +132,8 @@ static int digsig_verify_rsa(struct key *key,
mblen = mpi_get_nbits(pkey[0]);
mlen = (mblen + 7)/8;

err = -ENOMEM;
if (mlen == 0)
goto err;

out1 = kzalloc(mlen, GFP_KERNEL);
if (!out1)
Expand Down

0 comments on commit 7531c00

Please sign in to comment.