diff options
author | Thomas Graf <tgraf@suug.ch> | 2012-11-26 10:50:56 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2012-11-26 10:50:56 (GMT) |
commit | 4149154c226a47f67f5ad32b5532831534a755e9 (patch) | |
tree | cc1fa9ffa210bb7907503e5660d5e1135197a7c8 | |
parent | 05a6723eb5d63d9d1a3eb025b8f20dd6af2bde35 (diff) | |
download | libnl-4149154c226a47f67f5ad32b5532831534a755e9.zip libnl-4149154c226a47f67f5ad32b5532831534a755e9.tar.gz libnl-4149154c226a47f67f5ad32b5532831534a755e9.tar.bz2 |
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 <tgraf@suug.ch>
-rw-r--r-- | lib/cache.c | 7 |
1 files 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)); |