Blame SOURCES/dyninst-11.0.0-nullbuf.patch

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