Blame SOURCES/dyninst-11.0.0-nullbuf.patch

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