mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-26 04:02:09 +01:00
tests: Add missing assertion to guard against infinite loop
Since the loop variable changed signedness, it’s now possible for there to be an infinite loop if `get_match_count()` returns an error. Guard against that. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Coverity CID: #1436405
This commit is contained in:
parent
065dea99f4
commit
51f322b74c
@ -1316,6 +1316,7 @@ test_match_all (gconstpointer d)
|
||||
g_assert (match_ok);
|
||||
|
||||
match_count = g_match_info_get_match_count (match_info);
|
||||
g_assert_cmpint (match_count, >=, 0);
|
||||
|
||||
if (match_count != g_slist_length (data->expected))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user