pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pbulk-base pbulk-base-0.39:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e99002c76920
branches:  trunk
changeset: 563937:e99002c76920
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Sun Aug 23 18:02:04 2009 +0000

description:
pbulk-base-0.39:
Fix ordering of event handler vs queue modification. This can result in
queue corruption or use after free when the master can't handle a
request before the next arrives. From Matt Dillon.

diffstat:

 pkgtools/pbulk-base/Makefile           |  4 ++--
 pkgtools/pbulk/files/pbulk/lib/event.c |  4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diffs (34 lines):

diff -r 22edff4f3104 -r e99002c76920 pkgtools/pbulk-base/Makefile
--- a/pkgtools/pbulk-base/Makefile      Sun Aug 23 17:22:46 2009 +0000
+++ b/pkgtools/pbulk-base/Makefile      Sun Aug 23 18:02:04 2009 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.1 2009/06/07 18:07:00 joerg Exp $
+# $NetBSD: Makefile,v 1.2 2009/08/23 18:02:04 joerg Exp $
 
-DISTNAME=      pbulk-base-0.38
+DISTNAME=      pbulk-base-0.39
 COMMENT=       Core components of the modular bulk build framework
 
 PKG_DESTDIR_SUPPORT=   user-destdir
diff -r 22edff4f3104 -r e99002c76920 pkgtools/pbulk/files/pbulk/lib/event.c
--- a/pkgtools/pbulk/files/pbulk/lib/event.c    Sun Aug 23 17:22:46 2009 +0000
+++ b/pkgtools/pbulk/files/pbulk/lib/event.c    Sun Aug 23 18:02:04 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: event.c,v 1.5 2009/02/25 19:31:53 joerg Exp $ */
+/* $NetBSD: event.c,v 1.6 2009/08/23 18:02:04 joerg Exp $ */
 
 /*-
  * Copyright (c) 2007, 2009 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -348,11 +348,11 @@
                    iter < last_iter && ev && (next = LIST_NEXT(ev, ev_link), 1);
                    ev = next, ++iter) {
                        if (iter->revents) {
-                               (*ev->ev_handler)(ev->ev_fd, ev->ev_arg);
                                if (!ev->ev_persistent) {
                                        --active_events;
                                        LIST_REMOVE(ev, ev_link);
                                }
+                               (*ev->ev_handler)(ev->ev_fd, ev->ev_arg);
                                --ret;
                        }
                }



Home | Main Index | Thread Index | Old Index