mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-19 23:28:54 +02: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:
@@ -1316,6 +1316,7 @@ test_match_all (gconstpointer d)
|
|||||||
g_assert (match_ok);
|
g_assert (match_ok);
|
||||||
|
|
||||||
match_count = g_match_info_get_match_count (match_info);
|
match_count = g_match_info_get_match_count (match_info);
|
||||||
|
g_assert_cmpint (match_count, >=, 0);
|
||||||
|
|
||||||
if (match_count != g_slist_length (data->expected))
|
if (match_count != g_slist_length (data->expected))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user