pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools pbulk-base: fix double free().
details: https://anonhg.NetBSD.org/pkgsrc/rev/f47ecf1ec300
branches: trunk
changeset: 331066:f47ecf1ec300
user: wiz <wiz%pkgsrc.org@localhost>
date: Tue Mar 12 15:37:51 2019 +0000
description:
pbulk-base: fix double free().
Debugged by dillo & myself.
Bump version.
diffstat:
pkgtools/pbulk-base/Makefile | 4 ++--
pkgtools/pbulk/files/pbulk/lib/event.c | 14 ++++++++++----
2 files changed, 12 insertions(+), 6 deletions(-)
diffs (68 lines):
diff -r 54ff90f22cab -r f47ecf1ec300 pkgtools/pbulk-base/Makefile
--- a/pkgtools/pbulk-base/Makefile Tue Mar 12 13:21:16 2019 +0000
+++ b/pkgtools/pbulk-base/Makefile Tue Mar 12 15:37:51 2019 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.24 2016/06/23 15:07:39 joerg Exp $
+# $NetBSD: Makefile,v 1.25 2019/03/12 15:37:51 wiz Exp $
-DISTNAME= pbulk-base-0.53
+DISTNAME= pbulk-base-0.54
COMMENT= Core components of the modular bulk build framework
.include "../../pkgtools/pbulk/Makefile.common"
diff -r 54ff90f22cab -r f47ecf1ec300 pkgtools/pbulk/files/pbulk/lib/event.c
--- a/pkgtools/pbulk/files/pbulk/lib/event.c Tue Mar 12 13:21:16 2019 +0000
+++ b/pkgtools/pbulk/files/pbulk/lib/event.c Tue Mar 12 15:37:51 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: event.c,v 1.8 2017/02/25 21:21:53 joerg Exp $ */
+/* $NetBSD: event.c,v 1.9 2019/03/12 15:37:51 wiz Exp $ */
/*-
* Copyright (c) 2007, 2009 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -51,6 +51,8 @@
#include "pbulk.h"
+static struct event *poll_loop_next = NULL;
+
struct deferred_read_arg {
void *cb_arg;
void (*cb_ok)(void *);
@@ -206,6 +208,9 @@
void
event_del(struct event *ev)
{
+ if (ev == poll_loop_next) {
+ poll_loop_next = LIST_NEXT(ev, ev_link);
+ }
LIST_REMOVE(ev, ev_link);
--active_events;
}
@@ -303,7 +308,7 @@
event_dispatch(void)
{
struct timeval now;
- struct event *ev, *next;
+ struct event *ev;
struct pollfd *iter, *last_iter;
int ret, timeout;
@@ -345,8 +350,8 @@
if (ret > 0) {
iter = poll_list;
for (ev = LIST_FIRST(&all_events);
- iter < last_iter && ev && (next = LIST_NEXT(ev, ev_link), 1);
- ev = next, ++iter) {
+ iter < last_iter && ev && (poll_loop_next = LIST_NEXT(ev, ev_link), 1);
+ ev = poll_loop_next, ++iter) {
if (iter->revents) {
if (!ev->ev_persistent) {
--active_events;
@@ -356,6 +361,7 @@
--ret;
}
}
+ poll_loop_next = NULL;
}
goto loop;
}
Home |
Main Index |
Thread Index |
Old Index