mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 13:59:07 +02:00
+ 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:
parent
5fc019f31a
commit
e9dc9735a0
@ -277,6 +277,9 @@
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
if (TTinyHeapPointerArithmeticType(p) < TTinyHeapPointerArithmeticType(HeapOrg)) or
|
||||||
|
(TTinyHeapPointerArithmeticType(p) >= TTinyHeapPointerArithmeticType(HeapPtr)) then
|
||||||
|
HandleError(204);
|
||||||
oldsize := FindSize(p);
|
oldsize := FindSize(p);
|
||||||
OldAllocSize := align(oldsize+sizeof(TTinyHeapMemBlockSize), TinyHeapAllocGranularity);
|
OldAllocSize := align(oldsize+sizeof(TTinyHeapMemBlockSize), TinyHeapAllocGranularity);
|
||||||
NewAllocSize := align(size+sizeof(TTinyHeapMemBlockSize), TinyHeapAllocGranularity);
|
NewAllocSize := align(size+sizeof(TTinyHeapMemBlockSize), TinyHeapAllocGranularity);
|
||||||
|
Loading…
Reference in New Issue
Block a user