+ check whether the pointer passed to SysTinyReAllocMem is within the heap area

(the same check used as in SysTinyFreeMem)

git-svn-id: trunk@28721 -
This commit is contained in:
nickysn 2014-09-28 15:27:44 +00:00
parent 5fc019f31a
commit e9dc9735a0

View File

@ -277,6 +277,9 @@
end
else
begin
if (TTinyHeapPointerArithmeticType(p) < TTinyHeapPointerArithmeticType(HeapOrg)) or
(TTinyHeapPointerArithmeticType(p) >= TTinyHeapPointerArithmeticType(HeapPtr)) then
HandleError(204);
oldsize := FindSize(p);
OldAllocSize := align(oldsize+sizeof(TTinyHeapMemBlockSize), TinyHeapAllocGranularity);
NewAllocSize := align(size+sizeof(TTinyHeapMemBlockSize), TinyHeapAllocGranularity);