git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
69e427e
)
lib: Fix memalign_array overflow protection
author
Volker Lendecke
<vl@samba.org>
Wed, 18 Nov 2015 12:13:57 +0000
(13:13 +0100)
committer
Volker Lendecke
<vl@samba.org>
Thu, 19 Nov 2015 09:05:08 +0000
(10:05 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Nov 19 10:05:08 CET 2015 on sn-devel-104
lib/util/util.c
patch
|
blob
|
history
diff --git
a/lib/util/util.c
b/lib/util/util.c
index d8a84dab6d21375c38d490d4eb35c155572219f7..03edd7f7761571c915e9ee1907dd809a7ab54263 100644
(file)
--- a/
lib/util/util.c
+++ b/
lib/util/util.c
@@
-773,7
+773,7
@@
void *malloc_array(size_t el_size, unsigned int count)
void *memalign_array(size_t el_size, size_t align, unsigned int count)
{
- if (
count*el_size >= MAX_MALLOC_SIZE
) {
+ if (
el_size == 0 || count >= MAX_MALLOC_SIZE/el_size
) {
return NULL;
}