summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2015-06-03 16:31:12 -0400
committerRay Strode <rstrode@redhat.com>2018-04-03 14:16:18 -0400
commit5b8cd1a38696e7398e91863565dcfba792cbc744 (patch)
tree6593c9cab7e6b78f5c6c15a3f020fb99418d6764
parent539bf5dcca489534f42798a4500aca4b1a8ec8d0 (diff)
downloadpolkit-5b8cd1a38696e7398e91863565dcfba792cbc744.tar.gz
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
-rw-r--r--test/mocklibc/src/netgroup.c2
1 files changed, 1 insertions, 1 deletions
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
}