projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.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
|
blame
|
history
diff --git
a/lib/mpi/mpiutil.c
b/lib/mpi/mpiutil.c
index 6bfc41f62b8f45b14bd0d89581297df607ad7595..26e4ed31e256f793d4bdc21ea81f7f6a8ca4bf71 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);
}