[gimp] Issue #1748 - Crash when parsing currupt tool preset
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Issue #1748 - Crash when parsing currupt tool preset
- Date: Tue, 3 Jul 2018 23:54:45 +0000 (UTC)
commit e27e783f8836ca44ffd17d4c5190244dd024eb55
Author: Michael Natterer <mitch gimp org>
Date: Wed Jul 4 01:52:19 2018 +0200
Issue #1748 - Crash when parsing currupt tool preset
Bail out with an error instead of crashing when the tool options type
name is empty.
app/core/gimptoolpreset.c | 8 ++++++++
1 file changed, 8 insertions(+)
---
diff --git a/app/core/gimptoolpreset.c b/app/core/gimptoolpreset.c
index 8558850a4d..94083c0915 100644
--- a/app/core/gimptoolpreset.c
+++ b/app/core/gimptoolpreset.c
@@ -390,6 +390,14 @@ gimp_tool_preset_deserialize_property (GimpConfig *config,
break;
}
+ if (! (type_name && *type_name))
+ {
+ g_scanner_error (scanner, "GimpToolOptions type name is empty");
+ *expected = G_TOKEN_NONE;
+ g_free (type_name);
+ break;
+ }
+
if (! strcmp (type_name, "GimpTransformOptions"))
{
g_printerr ("Correcting tool options type GimpTransformOptions "
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]