On 22/04/2015 05:10, aandrejevic(a)svn.reactos.org wrote:
+static inline PXMS_HANDLE GetHandleRecord(WORD
Handle)
+{
+ PXMS_HANDLE Entry = &HandleTable[Handle - 1];
+ if (Handle == 0 || Handle >= XMS_MAX_HANDLES) return NULL;
+
+ return Entry->Size ? Entry : NULL;
+}
This looks highly dangerous to me and likely compiler dependent.
I'd rather perform the sanity checks before ever touching HandleTable,
especially because the value of Handle is coming right from caller
registers and have never been sanitized before.
--
Pierre Schweitzer <pierre at reactos.org>
System & Network Administrator
Senior Kernel Developer
ReactOS Deutschland e.V.