pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/pkgtools



Module Name:    pkgsrc
Committed By:   wiz
Date:           Tue Mar 12 15:37:51 UTC 2019

Modified Files:
        pkgsrc/pkgtools/pbulk-base: Makefile
        pkgsrc/pkgtools/pbulk/files/pbulk/lib: event.c

Log Message:
pbulk-base: fix double free().

Debugged by dillo & myself.

Bump version.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 pkgsrc/pkgtools/pbulk-base/Makefile
cvs rdiff -u -r1.8 -r1.9 pkgsrc/pkgtools/pbulk/files/pbulk/lib/event.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/pkgtools/pbulk-base/Makefile
diff -u pkgsrc/pkgtools/pbulk-base/Makefile:1.24 pkgsrc/pkgtools/pbulk-base/Makefile:1.25
--- pkgsrc/pkgtools/pbulk-base/Makefile:1.24    Thu Jun 23 15:07:39 2016
+++ pkgsrc/pkgtools/pbulk-base/Makefile Tue Mar 12 15:37:51 2019
@@ -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"

Index: pkgsrc/pkgtools/pbulk/files/pbulk/lib/event.c
diff -u pkgsrc/pkgtools/pbulk/files/pbulk/lib/event.c:1.8 pkgsrc/pkgtools/pbulk/files/pbulk/lib/event.c:1.9
--- pkgsrc/pkgtools/pbulk/files/pbulk/lib/event.c:1.8   Sat Feb 25 21:21:53 2017
+++ pkgsrc/pkgtools/pbulk/files/pbulk/lib/event.c       Tue Mar 12 15:37:51 2019
@@ -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 @@ event_add(struct event *ev, int fd, int 
 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 @@ void
 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 @@ loop:
        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 @@ loop:
                                --ret;
                        }
                }
+               poll_loop_next = NULL;
        }
        goto loop;
 }



Home | Main Index | Thread Index | Old Index