-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path3761-Fix-broken-sanity-check.patch
26 lines (22 loc) · 1.4 KB
/
3761-Fix-broken-sanity-check.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Wiz <[email protected]>
Date: Wed, 15 Dec 2021 16:00:13 -0500
Subject: [PATCH] 3761: Fix broken sanity check
If there were 0 rows selected, the assertion error would not be thrown, even though a size of 0 means nothing was selected. It is impossible for the length to be below 0. This could cause disasterous results.
---
.../plugin/core/disassembler/AutoTableDisassemblerPlugin.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/AutoTableDisassemblerPlugin.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/AutoTableDisassemblerPlugin.java
index 5814b1deb2..4c9d4ced81 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/AutoTableDisassemblerPlugin.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/AutoTableDisassemblerPlugin.java
@@ -434,7 +434,7 @@ public class AutoTableDisassemblerPlugin extends ProgramPlugin implements Domain
// address table in the selected rows
private int getIndexOfShortestAddressTable(int[] selectedRows) {
- if (selectedRows.length < 0) {
+ if (selectedRows.length == 0) {
throw new AssertionError(
"There must be rows selected in " + "order to process multiple rows.");
}
--
2.45.1