Blame SOURCES/dyninst-11.0.0-nullbuf.patch

13bab2
rhbz1965455
13bab2
13bab2
commit 212576147 (refs/bisect/new)
13bab2
Author: Xiaozhu Meng <mxz297@gmail.com>
13bab2
Date:   Wed May 26 11:26:28 2021 -0500
13bab2
13bab2
    Skip parsing of blocks whose code buffer is null (#1033)
13bab2
13bab2
--- dyninst-11.0.0/parseAPI/src/Parser.C.orig
13bab2
+++ dyninst-11.0.0/parseAPI/src/Parser.C
13bab2
@@ -1703,6 +1703,14 @@ Parser::parse_frame_one_iteration(ParseFrame &frame, bool recursive) {
13bab2
             cur->region()->offset() + cur->region()->length() - curAddr;
13bab2
         const unsigned char* bufferBegin =
13bab2
             (const unsigned char *)(func->region()->getPtrToInstruction(curAddr));
13bab2
+        if (bufferBegin == nullptr) {
13bab2
+            // This can happen if jump table is over-approxiated.
13bab2
+            // We ignore this block for now, and later the over-approximated block
13bab2
+            // will be removed.
13bab2
+            parsing_printf("\taddress %lx in a different region from the funcion entry at %lx, skip parsing\n", curAddr, func->addr());
13bab2
+            continue;
13bab2
+        }
13bab2
+
13bab2
         InstructionDecoder dec(bufferBegin,size,frame.codereg->getArch());
13bab2
 
13bab2
         if (!ahPtr)