From ce7f6fe1268fef4f89aa21c7b44d73ecd98efe24 Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Fri, 19 Oct 2007 19:40:04 -0400 Subject: [PATCH] xselinux: properly update sizes when dynamic arrays are resized... --- Xext/xselinux.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Xext/xselinux.c b/Xext/xselinux.c index 8b1898dac..14a2270e2 100644 --- a/Xext/xselinux.c +++ b/Xext/xselinux.c @@ -143,6 +143,7 @@ SELinuxEventToSID(int type, SELinuxStateRec *sid_return) return BadAlloc; memset(knownEvents + numKnownEvents, 0, (type - numKnownEvents + 1) * size); + numKnownEvents = type + 1; } if (!knownEvents[type]) { @@ -180,6 +181,7 @@ SELinuxTypeToClass(RESTYPE type) return 0; memset(knownTypes + numKnownTypes, 0, (type - numKnownTypes + 1) * size); + numKnownTypes = type + 1; } if (!knownTypes[type]) {