Module Name: src
Committed By: christos
Date: Sat Nov 6 20:40:12 UTC 2010
Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_io.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/ntpd/ntp_io.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.2 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.3
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.2 Sun Dec 13 19:43:58 2009
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c Sat Nov 6 16:40:12 2010
@@ -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 */