mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-23 02:32:11 +01:00
gthreadedresolver: Fix logic in parse_res_text()
and avoid a sign-compare warning. Fixes #2209
This commit is contained in:
parent
629bf398a2
commit
9ded33cf59
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user