[PATCH] D28502: [compiler-rt] [Interception] Properly check for export table's size before referring to its elements.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 17:00:45 PST 2017


mpividori removed rL LLVM as the repository for this revision.
mpividori updated this revision to Diff 83746.
mpividori added a comment.

Done.


https://reviews.llvm.org/D28502

Files:
  lib/interception/interception_win.cc


Index: lib/interception/interception_win.cc
===================================================================
--- lib/interception/interception_win.cc
+++ lib/interception/interception_win.cc
@@ -878,6 +878,8 @@
 
   IMAGE_DATA_DIRECTORY *export_directory =
       &headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT];
+  if (export_directory->Size == 0)
+    return 0;
   RVAPtr<IMAGE_EXPORT_DIRECTORY> exports(module,
                                          export_directory->VirtualAddress);
   RVAPtr<DWORD> functions(module, exports->AddressOfFunctions);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28502.83746.patch
Type: text/x-patch
Size: 580 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170110/7e538289/attachment.bin>


More information about the llvm-commits mailing list