xselinux: properly update sizes when dynamic arrays are resized...

This commit is contained in:
Eamon Walsh 2007-10-19 19:40:04 -04:00 committed by Eamon Walsh
parent 12e889d202
commit ce7f6fe126

View File

@ -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]) {