[PATCH] Fix CID 1415704 Integer overflowed argument

Volker Lendecke Volker.Lendecke at SerNet.DE
Thu Jul 27 12:10:28 UTC 2017


Hi!

Review appreciated!

Thanks, Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From 7fec377c560b598b676e5e3ffa6123a0836bef97 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Thu, 27 Jul 2017 14:09:20 +0200
Subject: [PATCH] lib: Fix 1415704 CID Integer overflowed argument

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 lib/uid_wrapper/uid_wrapper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/uid_wrapper/uid_wrapper.c b/lib/uid_wrapper/uid_wrapper.c
index 0d74d203627..cb31c5e8b00 100644
--- a/lib/uid_wrapper/uid_wrapper.c
+++ b/lib/uid_wrapper/uid_wrapper.c
@@ -1035,7 +1035,7 @@ static void uwrap_init_env(struct uwrap_thread *id)
 		id->ngroups = 0;
 
 		free(id->groups);
-		id->groups = malloc(sizeof(gid_t) * ngroups);
+		id->groups = calloc(ngroups, sizeof(gid_t));
 		if (id->groups == NULL) {
 			UWRAP_LOG(UWRAP_LOG_ERROR,
 				  "Unable to allocate memory");
-- 
2.11.0



More information about the samba-technical mailing list