diff options
author | David Cantrell <dcantrell@redhat.com> | 2008-02-04 10:50:06 -1000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2008-02-04 10:50:06 -1000 |
commit | 90f1447d542c6575b58edb6d17a3d946dbebace0 (patch) | |
tree | 9a0f38a118b9307364bcbeda034afd86365cfa2e /isys | |
parent | 3db06dee7802729ff373ab13f94ff78bfe50230a (diff) | |
download | anaconda-90f1447d542c6575b58edb6d17a3d946dbebace0.tar.gz anaconda-90f1447d542c6575b58edb6d17a3d946dbebace0.tar.xz anaconda-90f1447d542c6575b58edb6d17a3d946dbebace0.zip |
Avoid infinite loop in nl_ip2str().
Both continue statements would iterate over the same address
again. Moved nl_cache_get_next() call to just be inside the
expression for the while.
Diffstat (limited to 'isys')
-rw-r--r-- | isys/nl.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -92,8 +92,7 @@ char *nl_ip2str(char *ifname) { } /* find the IPv4 and IPv6 addresses for this interface */ - obj = nl_cache_get_first(cache); - while (obj) { + while ((obj = nl_cache_get_first(cache)) != NULL) { raddr = (struct rtnl_addr *) obj; if (rtnl_addr_get_ifindex(raddr) == ifindex) { @@ -157,8 +156,6 @@ char *nl_ip2str(char *ifname) { } } } - - obj = nl_cache_get_next(obj); } ip2str_error: |