Blame SOURCES/dyninst-11.0.0-nullbuf.patch

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