[glib: 9/11] xdgmime: Prevent infinite loops from badly-formed MIME registrations
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 9/11] xdgmime: Prevent infinite loops from badly-formed MIME registrations
- Date: Mon, 27 Sep 2021 11:50:50 +0000 (UTC)
commit 38869ece243068f3e76d160837bdac5d437325d4
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 2f519a43a..3818180ae 100644
--- a/gio/xdgmime/xdgmimecache.c
+++ b/gio/xdgmime/xdgmimecache.c
@@ -966,7 +966,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]