projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b35e286
)
lib/mpi: check for possible zero length
author
Dmitry Kasatkin
<dmitry.kasatkin@intel.com>
Thu, 26 Jan 2012 17:13:19 +0000
(19:13 +0200)
committer
James Morris
<jmorris@namei.org>
Wed, 1 Feb 2012 13:23:39 +0000
(
00:23
+1100)
Buggy client might pass zero nlimbs which is meaningless.
Added check for zero length.
Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Reviewed-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <jmorris@namei.org>
lib/mpi/mpiutil.c
patch
|
blob
|
history
diff --git
a/lib/mpi/mpiutil.c
b/lib/mpi/mpiutil.c
index
6bfc41f
..
26e4ed3
100644
(file)
--- a/
lib/mpi/mpiutil.c
+++ b/
lib/mpi/mpiutil.c
@@
-58,6
+58,9
@@
mpi_ptr_t mpi_alloc_limb_space(unsigned nlimbs)
{
size_t len = nlimbs * sizeof(mpi_limb_t);
+ if (!len)
+ return NULL;
+
return kmalloc(len, GFP_KERNEL);
}