about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2023-04-03 10:33:59 +0200
committerGitHub <noreply@github.com>2023-04-03 10:33:59 +0200
commit5fea071ae99dc68d634afd996fcd280f57f78002 (patch)
treede36b6eadfbd873251853077f7fc344b65febbfb
parent319b2e8e6f64bd35c5395c8a9e5053f25875a86d (diff)
parenta01138e1c822b97cf187bfcad9938597bf3edc1e (diff)
downloadafl++-5fea071ae99dc68d634afd996fcd280f57f78002.tar.gz
Merge pull request #1692 from nj00001/dev
fix getOperand out of range
-rw-r--r--instrumentation/afl-llvm-common.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/instrumentation/afl-llvm-common.cc b/instrumentation/afl-llvm-common.cc
index dc34d191..de334fb7 100644
--- a/instrumentation/afl-llvm-common.cc
+++ b/instrumentation/afl-llvm-common.cc
@@ -289,6 +289,9 @@ void scanForDangerousFunctions(llvm::Module *M) {
 
     StringRef ifunc_name = IF.getName();
     Constant *r = IF.getResolver();
+    if(r->getNumOperands() == 0){
+      continue ;
+    }
     StringRef r_name = cast<Function>(r->getOperand(0))->getName();
     if (!be_quiet)
       fprintf(stderr,