mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-13 02:20:37 +08:00
GP-6736 escape bsim filter data
This commit is contained in:
+5
-1
@@ -17,6 +17,8 @@ package ghidra.features.bsim.gui.filters;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.postgresql.core.Utils;
|
||||
|
||||
import ghidra.features.bsim.query.client.IDSQLResolution;
|
||||
import ghidra.features.bsim.query.client.SQLEffects;
|
||||
import ghidra.features.bsim.query.description.ExecutableRecord;
|
||||
@@ -39,7 +41,9 @@ public class ExecutableNameBSimFilterType extends BSimFilterType {
|
||||
throws SQLException {
|
||||
effect.setExeTable();
|
||||
StringBuilder buf = new StringBuilder();
|
||||
buf.append("exetable.name_exec = '").append(atom.value).append('\'');
|
||||
buf.append("exetable.name_exec = '");
|
||||
Utils.escapeLiteral(buf, atom.value, true);
|
||||
buf.append('\'');
|
||||
effect.addWhere(this, buf.toString());
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -17,6 +17,8 @@ package ghidra.features.bsim.gui.filters;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.postgresql.core.Utils;
|
||||
|
||||
import ghidra.features.bsim.query.client.IDSQLResolution;
|
||||
import ghidra.features.bsim.query.client.SQLEffects;
|
||||
import ghidra.features.bsim.query.description.ExecutableRecord;
|
||||
@@ -38,7 +40,9 @@ public class NotExecutableNameBSimFilterType extends BSimFilterType {
|
||||
throws SQLException {
|
||||
effect.setExeTable();
|
||||
StringBuilder buf = new StringBuilder();
|
||||
buf.append("exetable.name_exec != '").append(atom.value).append('\'');
|
||||
buf.append("exetable.name_exec != '");
|
||||
Utils.escapeLiteral(buf, atom.value, true);
|
||||
buf.append('\'');
|
||||
effect.addWhere(this, buf.toString());
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -17,6 +17,8 @@ package ghidra.features.bsim.gui.filters;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.postgresql.core.Utils;
|
||||
|
||||
import ghidra.features.bsim.query.client.IDSQLResolution;
|
||||
import ghidra.features.bsim.query.client.SQLEffects;
|
||||
import ghidra.features.bsim.query.description.ExecutableRecord;
|
||||
@@ -40,7 +42,9 @@ public class PathStartsBSimFilterType extends BSimFilterType {
|
||||
effect.setExeTable();
|
||||
effect.setPathTable();
|
||||
StringBuilder buf = new StringBuilder();
|
||||
buf.append("position( \'").append(atom.value).append("\' in pathtable.val) = 1");
|
||||
buf.append("position( '");
|
||||
Utils.escapeLiteral(buf, atom.value, true);
|
||||
buf.append("' in pathtable.val) = 1");
|
||||
effect.addWhere(this, buf.toString());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user