mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
gthreadedresolver: Fix logic in parse_res_text()
and avoid a sign-compare warning. Fixes #2209
This commit is contained in:
parent
f2df054673
commit
a3b5e188aa
@ -620,7 +620,7 @@ parse_res_txt (guchar *answer,
|
|||||||
while (at < end)
|
while (at < end)
|
||||||
{
|
{
|
||||||
len = *(at++);
|
len = *(at++);
|
||||||
if (len > at - end)
|
if (len > (gsize) (end - at))
|
||||||
break;
|
break;
|
||||||
g_ptr_array_add (array, g_strndup ((gchar *)at, len));
|
g_ptr_array_add (array, g_strndup ((gchar *)at, len));
|
||||||
at += len;
|
at += len;
|
||||||
|
Loading…
Reference in New Issue
Block a user