libwbclient: Fix a division by zero
authorVolker Lendecke <vl@samba.org>
Sat, 27 Nov 2010 18:02:33 +0000 (19:02 +0100)
committerVolker Lendecke <vlendec@samba.org>
Sat, 27 Nov 2010 18:11:03 +0000 (19:11 +0100)
If wbinfo -r returns no groups, wbcAllocateMemory divides by zero

nsswitch/libwbclient/wbc_pwd.c

index 1527808d888d98eb581ccdee5a8eafccb9455e75..abd03d74558b5a13b2d00c0986e90d671c6e4aaa 100644 (file)
@@ -605,7 +605,7 @@ wbcErr wbcGetGroups(const char *account,
        BAIL_ON_WBC_ERROR(wbc_status);
 
        groups = (gid_t *)wbcAllocateMemory(
-               sizeof(gid_t), response.data.num_entries, NULL);
+               response.data.num_entries, sizeof(gid_t), NULL);
        BAIL_ON_PTR_ERROR(groups, wbc_status);
 
        for (i = 0; i < response.data.num_entries; i++) {