Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/ntp/dist/ntpd PR/44052: Takahiro HAYASHI: chroo...



details:   https://anonhg.NetBSD.org/src/rev/2fff21ce183e
branches:  trunk
changeset: 758516:2fff21ce183e
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Nov 06 20:40:12 2010 +0000

description:
PR/44052: Takahiro HAYASHI: chrooted ntpd refers freed memory
As mentioned in the pr, process_routing_msgs can delete the current reader,
so cache the next element before calling it.

diffstat:

 external/bsd/ntp/dist/ntpd/ntp_io.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (25 lines):

diff -r 03c5c867a944 -r 2fff21ce183e external/bsd/ntp/dist/ntpd/ntp_io.c
--- a/external/bsd/ntp/dist/ntpd/ntp_io.c       Sat Nov 06 17:20:07 2010 +0000
+++ b/external/bsd/ntp/dist/ntpd/ntp_io.c       Sat Nov 06 20:40:12 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntp_io.c,v 1.2 2009/12/14 00:43:58 christos Exp $      */
+/*     $NetBSD: ntp_io.c,v 1.3 2010/11/06 20:40:12 christos Exp $      */
 
 /*
  * ntp_io.c - input/output routines for ntpd.  The socket-opening code
@@ -3355,11 +3355,14 @@
        asyncio_reader = asyncio_reader_list;
 
        while (asyncio_reader != NULL) {
+               struct asyncio_reader *next = asyncio_reader->link;
+
                if (FD_ISSET(asyncio_reader->fd, &fds)) {
                        ++select_count;
                        (asyncio_reader->receiver)(asyncio_reader);
                }
-               asyncio_reader = asyncio_reader->link;
+
+               asyncio_reader = next;
        }
 #endif /* HAS_ROUTING_SOCKET */
        



Home | Main Index | Thread Index | Old Index