Blame SOURCES/dyninst-11.0.0-nullbuf.patch

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