mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
gresource: Fix handling of zero-sized compressed resource entries
The zlib `GConverter` can’t handle an output buffer of size 0. Add tests. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #1560
This commit is contained in:
@@ -800,7 +800,9 @@ g_resource_lookup_data (GResource *resource,
|
||||
if (!do_lookup (resource, path, lookup_flags, &size, &flags, &data, &data_size, error))
|
||||
return NULL;
|
||||
|
||||
if (flags & G_RESOURCE_FLAGS_COMPRESSED)
|
||||
if (size == 0)
|
||||
return g_bytes_new_with_free_func ("", 0, (GDestroyNotify) g_resource_unref, g_resource_ref (resource));
|
||||
else if (flags & G_RESOURCE_FLAGS_COMPRESSED)
|
||||
{
|
||||
char *uncompressed, *d;
|
||||
const char *s;
|
||||
|
Reference in New Issue
Block a user