浏览代码

Patch from Vincent Snijders, sent to fpc-devel
add the same sanity check for the frame pointer
in TraceReAllocMem as already is in TraceGetMem.

git-svn-id: trunk@7086 -

pierre 18 年之前
父节点
当前提交
9137533864
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      rtl/inc/heaptrc.pp

+ 4 - 0
rtl/inc/heaptrc.pp

@@ -628,6 +628,7 @@ var
   allocsize,
   movesize,
   i  : ptrint;
+  oldbp,
   bp : pointer;
   pl : pdword;
   pp : pheap_mem_info;
@@ -745,7 +746,10 @@ begin
   for i:=1 to tracesize do
    begin
      pp^.calls[i]:=get_caller_addr(bp);
+     oldbp:=bp;
      bp:=get_caller_frame(bp);
+     if (bp<oldbp) or (bp>(StackBottom + StackLength)) then
+       bp:=nil;
    end;
   { regenerate signature }
   if usecrc then