xserver: Branch 'server-1.6-branch'

Eamon Walsh ewalsh at kemper.freedesktop.org
Wed Apr 8 23:50:35 PDT 2009


 Xext/xselinux.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 50894e13545538ed93f20823f7ba81d1ab8906bb
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Thu Apr 9 02:48:04 2009 -0400

    xselinux: Don't BadAlloc in List* requests if there are no items to list.
    (cherry picked from commit 682d7b55699cacbb2dbcd84a5e816bf6e2d2f02a)

diff --git a/Xext/xselinux.c b/Xext/xselinux.c
index a175c2c..2a32bb8 100644
--- a/Xext/xselinux.c
+++ b/Xext/xselinux.c
@@ -1570,7 +1570,7 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec *items,
     CARD32 *buf;
 
     buf = xcalloc(size, sizeof(CARD32));
-    if (!buf) {
+    if (size && !buf) {
 	rc = BadAlloc;
 	goto out;
     }
@@ -1642,7 +1642,7 @@ ProcSELinuxListProperties(ClientPtr client)
     for (pProp = wUserProps(pWin); pProp; pProp = pProp->next)
 	count++;
     items = xcalloc(count, sizeof(SELinuxListItemRec));
-    if (!items)
+    if (count && !items)
 	return BadAlloc;
 
     /* Fill in the items and calculate size */
@@ -1676,7 +1676,7 @@ ProcSELinuxListSelections(ClientPtr client)
     for (pSel = CurrentSelections; pSel; pSel = pSel->next)
 	count++;
     items = xcalloc(count, sizeof(SELinuxListItemRec));
-    if (!items)
+    if (count && !items)
 	return BadAlloc;
 
     /* Fill in the items and calculate size */


More information about the xorg-commit mailing list