artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
60c703a
)
fix a non safe use of LIST_FOREACH with LIST_REMOVE
author
jsg
<jsg@openbsd.org>
Fri, 22 May 2015 01:30:27 +0000
(
01:30
+0000)
committer
jsg
<jsg@openbsd.org>
Fri, 22 May 2015 01:30:27 +0000
(
01:30
+0000)
ok claudio@ kettenis@ reyk@
usr.sbin/dvmrpd/rde_srt.c
patch
|
blob
|
history
diff --git
a/usr.sbin/dvmrpd/rde_srt.c
b/usr.sbin/dvmrpd/rde_srt.c
index
d646c24
..
cb8c328
100644
(file)
--- a/
usr.sbin/dvmrpd/rde_srt.c
+++ b/
usr.sbin/dvmrpd/rde_srt.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: rde_srt.c,v 1.2
5 2010/09/02 14:03:21 sobrado
Exp $ */
+/* $OpenBSD: rde_srt.c,v 1.2
6 2015/05/22 01:30:27 jsg
Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@
-225,7
+225,7
@@
rt_remove(struct rt_node *r)
return (-1);
}
-
LIST_FOREACH(ds_nbr, &r->ds_list, entry
) {
+
while ((ds_nbr = LIST_FIRST(&r->ds_list)) != NULL
) {
LIST_REMOVE(ds_nbr, entry);
free(ds_nbr);
}