From 4149154c226a47f67f5ad32b5532831534a755e9 Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Mon, 26 Nov 2012 11:50:56 +0100 Subject: [PATCH] cache: only continue iterating over co_groups if it is available A co_groups == NULL must enter the loop to trigger the initial fill of the cache but may never bump the grp pointer as doing so prevents the loop from being escaped correctly. Signed-off-by: Thomas Graf --- lib/cache.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/cache.c b/lib/cache.c index 415e471..8ba3d5b 100644 --- a/lib/cache.c +++ b/lib/cache.c @@ -829,7 +829,9 @@ restart: goto restart; else if (err < 0) goto errout; - grp++; + + if (grp) + grp++; } while (grp && grp->ag_group && (cache->c_flags & NL_CACHE_AF_ITER)); @@ -935,7 +937,8 @@ restart: } else if (err < 0) break; - grp++; + if (grp) + grp++; } while (grp && grp->ag_group && (cache->c_flags & NL_CACHE_AF_ITER));