[glib: 1/2] gthreadedresolver: Fix logic in parse_res_text()
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/2] gthreadedresolver: Fix logic in parse_res_text()
- Date: Wed, 30 Sep 2020 15:45:07 +0000 (UTC)
commit a3b5e188aa70ad57b119b2b24f94a4d639174bab
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 48435b36f..d170c73a9 100644
--- a/gio/gthreadedresolver.c
+++ b/gio/gthreadedresolver.c
@@ -620,7 +620,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]