mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 23:16:14 +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)
|
||||
{
|
||||
len = *(at++);
|
||||
if (len > at - end)
|
||||
if (len > (gsize) (end - at))
|
||||
break;
|
||||
g_ptr_array_add (array, g_strndup ((gchar *)at, len));
|
||||
at += len;
|
||||
|
Loading…
Reference in New Issue
Block a user