Pārlūkot izejas kodu

* Fixed UnhookSignal when RTL_SIGDEFAULT is passed. The bug have caused crash on aarch64-android due to out of bounds read of the rtlsig2ossig[] array.

git-svn-id: trunk@39860 -
yury 6 gadi atpakaļ
vecāks
revīzija
23006d16f5
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      rtl/unix/sysutils.pp

+ 1 - 1
rtl/unix/sysutils.pp

@@ -274,7 +274,7 @@ procedure UnhookSignal(RtlSigNum: Integer; OnlyIfHooked: Boolean = True);
                 fillchar(act,sizeof(act),0);
                 fillchar(act,sizeof(act),0);
                 pointer(act.sa_handler):=pointer(SIG_DFL);
                 pointer(act.sa_handler):=pointer(SIG_DFL);
               end;
               end;
-            if (fpsigaction(rtlsig2ossig[RtlSigNum],@act,nil)=0) then
+            if (fpsigaction(rtlsig2ossig[i],@act,nil)=0) then
               siginfo[i].hooked:=false;
               siginfo[i].hooked:=false;
           end;
           end;
       end;
       end;