From 5b8cd1a38696e7398e91863565dcfba792cbc744 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 3 Jun 2015 16:31:12 -0400 Subject: tests: Correct boundary test for overflow The offset has to be strictly less than the max. https://bugs.freedesktop.org/show_bug.cgi?id=87716 --- test/mocklibc/src/netgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/mocklibc/src/netgroup.c b/test/mocklibc/src/netgroup.c index bc99555..06a8a89 100644 --- a/test/mocklibc/src/netgroup.c +++ b/test/mocklibc/src/netgroup.c @@ -326,7 +326,7 @@ struct entry *netgroup_iter_next(struct netgroup_iter *iter) { // Grow the stack iter->depth++; - if (iter->depth > NETGROUP_MAX_DEPTH) { + if (iter->depth >= NETGROUP_MAX_DEPTH) { iter->depth = -1; return NULL; // Too much recursion } -- cgit v1.2.1