Skip to content

Commit f28de52

Browse files
committed
syscalls2: Add null check for guest instruction in syscall callback
1 parent 548c5d5 commit f28de52

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

panda/plugins/syscalls2/syscalls2.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,11 @@ void before_tcg_codegen(CPUState *cpu, TranslationBlock *tb){
11941194
#endif
11951195
if(res != 0 && res != (target_ulong) -1){
11961196
TCGOp *op = find_guest_insn_by_addr(res);
1197-
insert_call(&op, syscall_callback, tb, res, profile, static_callno);
1197+
if (op != NULL){
1198+
insert_call(&op, syscall_callback, tb, res, profile, static_callno);
1199+
}else{
1200+
LOG_WARNING("Could not find guest instruction at syscall address " TARGET_PTR_FMT "\n", res);
1201+
}
11981202
}
11991203
}
12001204

0 commit comments

Comments
 (0)