projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
lib/digsig: digsig_verify_rsa(): return -EINVAL if modulo length is zero
[linux-2.6-microblaze.git]
/
lib
/
digsig.c
diff --git
a/lib/digsig.c
b/lib/digsig.c
index
a121cbc
..
55b8b2f
100644
(file)
--- a/
lib/digsig.c
+++ b/
lib/digsig.c
@@
-114,13
+114,15
@@
static int digsig_verify_rsa(struct key *key,
datap += remaining;
}
- err = -ENOMEM;
-
mblen = mpi_get_nbits(pkey[0]);
mlen = DIV_ROUND_UP(mblen, 8);
- if (mlen == 0)
+ if (mlen == 0) {
+ err = -EINVAL;
goto err;
+ }
+
+ err = -ENOMEM;
out1 = kzalloc(mlen, GFP_KERNEL);
if (!out1)