[glib/glib-2-64: 1/2] gthreadedresolver: Fix logic in parse_res_text()
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-64: 1/2] gthreadedresolver: Fix logic in parse_res_text()
- Date: Thu, 1 Oct 2020 06:02:18 +0000 (UTC)
commit 9ded33cf59051c1f25912d8d83717375e62ff635
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Sat Sep 26 11:11:44 2020 -0400
gthreadedresolver: Fix logic in parse_res_text()
and avoid a sign-compare warning.
Fixes #2209
gio/gthreadedresolver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
index 7691b9124..8fb70366d 100644
--- a/gio/gthreadedresolver.c
+++ b/gio/gthreadedresolver.c
@@ -615,7 +615,7 @@ parse_res_txt (guchar *answer,
while (at < end)
{
len = *(at++);
- if (len > at - end)
+ if (len > (gsize) (end - at))
break;
g_ptr_array_add (array, g_strndup ((gchar *)at, len));
at += len;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]