1
0
mirror of https://github.com/samba-team/samba.git synced 2025-09-03 05:49:28 +03:00

lib: Fix memalign_array overflow protection

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
This commit is contained in:
Volker Lendecke
2015-11-18 13:13:57 +01:00
parent 69e427ecee
commit 155eeac5ac

View File

@@ -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;
}