mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 17:27:43 +00:00
1087: Error/Exception from ImageGallery in creating groups
- escape group property name as well as value.
This commit is contained in:
parent
82b856e05f
commit
aa8a1714cf
@ -698,7 +698,7 @@ public final class DrawableDB {
|
|||||||
// query to find the group id from attribute/value
|
// query to find the group id from attribute/value
|
||||||
return String.format(" SELECT group_id FROM " + GROUPS_TABLENAME
|
return String.format(" SELECT group_id FROM " + GROUPS_TABLENAME
|
||||||
+ " WHERE attribute = \'%s\' AND value = \'%s\' AND data_source_obj_id = %d",
|
+ " WHERE attribute = \'%s\' AND value = \'%s\' AND data_source_obj_id = %d",
|
||||||
groupKey.getAttribute().attrName.toString(),
|
SleuthkitCase.escapeSingleQuotes(groupKey.getAttribute().attrName.toString()),
|
||||||
SleuthkitCase.escapeSingleQuotes(groupKey.getValueDisplayName()),
|
SleuthkitCase.escapeSingleQuotes(groupKey.getValueDisplayName()),
|
||||||
(groupKey.getAttribute() == DrawableAttribute.PATH) ? groupKey.getDataSourceObjId() : 0);
|
(groupKey.getAttribute() == DrawableAttribute.PATH) ? groupKey.getDataSourceObjId() : 0);
|
||||||
}
|
}
|
||||||
@ -776,7 +776,7 @@ public final class DrawableDB {
|
|||||||
// query to find the group id from attribute/value
|
// query to find the group id from attribute/value
|
||||||
String innerQuery = String.format("( SELECT group_id FROM " + GROUPS_TABLENAME
|
String innerQuery = String.format("( SELECT group_id FROM " + GROUPS_TABLENAME
|
||||||
+ " WHERE attribute = \'%s\' AND value = \'%s\' and data_source_obj_id = %d )",
|
+ " WHERE attribute = \'%s\' AND value = \'%s\' and data_source_obj_id = %d )",
|
||||||
groupKey.getAttribute().attrName.toString(),
|
SleuthkitCase.escapeSingleQuotes(groupKey.getAttribute().attrName.toString()),
|
||||||
SleuthkitCase.escapeSingleQuotes(groupKey.getValueDisplayName()),
|
SleuthkitCase.escapeSingleQuotes(groupKey.getValueDisplayName()),
|
||||||
groupKey.getAttribute() == DrawableAttribute.PATH ? groupKey.getDataSourceObjId() : 0);
|
groupKey.getAttribute() == DrawableAttribute.PATH ? groupKey.getDataSourceObjId() : 0);
|
||||||
|
|
||||||
@ -1408,7 +1408,7 @@ public final class DrawableDB {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
String insertSQL = String.format(" (data_source_obj_id, value, attribute) VALUES (%d, \'%s\', \'%s\')",
|
String insertSQL = String.format(" (data_source_obj_id, value, attribute) VALUES (%d, \'%s\', \'%s\')",
|
||||||
ds_obj_id, SleuthkitCase.escapeSingleQuotes(value), groupBy.attrName.toString());
|
ds_obj_id, SleuthkitCase.escapeSingleQuotes(value), SleuthkitCase.escapeSingleQuotes(groupBy.attrName.toString()));
|
||||||
|
|
||||||
if (DbType.POSTGRESQL == tskCase.getDatabaseType()) {
|
if (DbType.POSTGRESQL == tskCase.getDatabaseType()) {
|
||||||
insertSQL += " ON CONFLICT DO NOTHING";
|
insertSQL += " ON CONFLICT DO NOTHING";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user