[glib/glib-2-62: 1/2] xdgmime: Prevent infinite loops from badly-formed MIME registrations
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-62: 1/2] xdgmime: Prevent infinite loops from badly-formed MIME registrations
- Date: Fri, 13 Sep 2019 13:58:41 +0000 (UTC)
commit a105470155eb347a3fcedaa5178cd8bbe50f1404
Author: Philip Withnall <withnall endlessm com>
Date: Mon Sep 2 18:02:05 2019 +0100
xdgmime: Prevent infinite loops from badly-formed MIME registrations
Signed-off-by: Philip Withnall <withnall endlessm com>
Closes: #1875
gio/xdgmime/xdgmimecache.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gio/xdgmime/xdgmimecache.c b/gio/xdgmime/xdgmimecache.c
index 8010f9e5b..769b57836 100644
--- a/gio/xdgmime/xdgmimecache.c
+++ b/gio/xdgmime/xdgmimecache.c
@@ -965,7 +965,9 @@ _xdg_mime_cache_mime_type_subclass (const char *mime,
for (j = 0; j < n_parents; j++)
{
parent_offset = GET_UINT32 (cache->buffer, offset + 4 + 4 * j);
- if (_xdg_mime_cache_mime_type_subclass (cache->buffer + parent_offset, ubase))
+ if (strcmp (cache->buffer + parent_offset, mime) != 0 &&
+ strcmp (cache->buffer + parent_offset, umime) != 0 &&
+ _xdg_mime_cache_mime_type_subclass (cache->buffer + parent_offset, ubase))
return 1;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]