Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115885610
D26790.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1006 B
Referenced Files
None
Subscribers
None
D26790.diff
View Options
Index: head/lib/libnetmap/nmreq.c
===================================================================
--- head/lib/libnetmap/nmreq.c
+++ head/lib/libnetmap/nmreq.c
@@ -603,10 +603,9 @@
struct nmreq_option *
nmreq_find_option(struct nmreq_header *h, uint32_t t)
{
- struct nmreq_option *o;
+ struct nmreq_option *o = NULL;
- for (o = (struct nmreq_option *)h->nr_options; o != NULL;
- o = (struct nmreq_option *)o->nro_next) {
+ nmreq_foreach_option(h, o) {
if (o->nro_reqtype == t)
break;
}
@@ -633,8 +632,14 @@
{
struct nmreq_option *o, *next;
- for (o = (struct nmreq_option *)h->nr_options; o != NULL; o = next) {
- next = (struct nmreq_option *)o->nro_next;
+ /*
+ * Note: can't use nmreq_foreach_option() here; it frees the
+ * list as it's walking and nmreq_foreach_option() isn't
+ * modification-safe.
+ */
+ for (o = (struct nmreq_option *)(uintptr_t)h->nr_options; o != NULL;
+ o = next) {
+ next = (struct nmreq_option *)(uintptr_t)o->nro_next;
free(o);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, May 1, 12:23 AM (9 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17868217
Default Alt Text
D26790.diff (1006 B)
Attached To
Mode
D26790: [libnetmap] Fix 32 bit compilation on gcc-6.3
Attached
Detach File
Event Timeline
Log In to Comment