diff options
author | 2010-03-26 15:38:39 +0000 | |
---|---|---|
committer | 2010-03-26 15:38:39 +0000 | |
commit | a2629ab6f990e2e264448b26fc415efba88aed69 (patch) | |
tree | 03ac38e95a88449488d1e70417663c7e8ba2711f | |
parent | sync with kristaps@ version of mandoc_char(7) in mdocml-1.9.17 (diff) | |
download | wireguard-openbsd-a2629ab6f990e2e264448b26fc415efba88aed69.tar.xz wireguard-openbsd-a2629ab6f990e2e264448b26fc415efba88aed69.zip |
Be more careful when walking the tree looking for a non-empty element,
we may actually hit the end of the tree (at least in theory).
-rw-r--r-- | usr.sbin/bgpd/rde_rib.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/rde_rib.c b/usr.sbin/bgpd/rde_rib.c index 7120cc1c364..db17366ed1e 100644 --- a/usr.sbin/bgpd/rde_rib.c +++ b/usr.sbin/bgpd/rde_rib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_rib.c,v 1.121 2010/03/03 13:52:39 claudio Exp $ */ +/* $OpenBSD: rde_rib.c,v 1.122 2010/03/26 15:38:39 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> @@ -310,7 +310,7 @@ rib_restart(struct rib_context *ctx) re->flags &= ~F_RIB_ENTRYLOCK; /* find first non empty element */ - while (rib_empty(re)) + while (re && rib_empty(re)) re = RB_NEXT(rib_tree, unused, re); /* free the previously locked rib element if empty */ |