Blob Blame History Raw
From 0e76322666c91affc47387d88260a8774a634eaa Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose@redhat.com>
Date: Wed, 25 Feb 2015 10:28:22 +0100
Subject: [PATCH] extdom: fix wrong realloc size

---
 daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_common.c b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_common.c
index 47bcb179f04e08c64d92f55809b84f2d59622344..686128e9bb6994cf442c1cc9ff725657584e17be 100644
--- a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_common.c
+++ b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_common.c
@@ -386,7 +386,7 @@ static int get_user_grouplist(const char *name, gid_t gid,
 
     ret = getgrouplist(name, gid, groups, &ngroups);
     if (ret == -1) {
-        new_groups = realloc(groups, ngroups);
+        new_groups = realloc(groups, ngroups * sizeof(gid_t));
         if (new_groups == NULL) {
             free(groups);
             return LDAP_OPERATIONS_ERROR;
-- 
2.1.0