Skip to content

Commit aad2a59

Browse files
committed
xcf: Don't try to deserialize an empty GimpConfig string
When loading a GimpConfig property for a filter, we assumed that the string is always valid. This patch adds code to check if we read in the string correctly - if we didn't (or if it was tampered with), we don't try to deserialize an empty string.
1 parent 4b582bd commit aad2a59

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

app/xcf/xcf-load.c

+11
Original file line numberDiff line numberDiff line change
@@ -2634,6 +2634,17 @@ xcf_load_effect_props (XcfInfo *info,
26342634
}
26352635

26362636
xcf_read_string (info, &serialized, 1);
2637+
if (! (serialized && strlen (serialized)))
2638+
{
2639+
gimp_message (info->gimp, G_OBJECT (info->progress),
2640+
GIMP_MESSAGE_WARNING,
2641+
"XCF Warning: failure to deserialize config object for property '%s' of filter '%s'.\n"
2642+
"Serialized config could not be read.",
2643+
filter_prop_name, filter->operation_name);
2644+
valid_prop_value = FALSE;
2645+
break;
2646+
}
2647+
26372648
g_value_init (&filter_prop_value, pspec->value_type);
26382649
config = g_object_new (pspec->value_type, NULL);
26392650
if (gimp_config_deserialize_string (GIMP_CONFIG (config), serialized, -1, NULL, &error))

0 commit comments

Comments
 (0)