[ntp:bk-ntp-dev-send] BitKeeper diffs

Harlan Stenn stenn at deacon.udel.edu
Sun Apr 17 01:28:37 UTC 2011


#### ChangeSet ####
2011-04-16 18:14:13+00:00, davehart at shiny.ad.hartbrothers.com
  [Bug 1887] DNS fails on 4.2.7p153 using threads.

==== ChangeLog ====
2011-04-16 18:14:12+00:00, davehart at shiny.ad.hartbrothers.com +1 -0
  [Bug 1887] DNS fails on 4.2.7p153 using threads.

--- 1.852/ChangeLog	2011-04-16 03:31:42 -04:00
+++ 1.853/ChangeLog	2011-04-16 14:14:12 -04:00
@@ -1,3 +1,4 @@
+* [Bug 1887] DNS fails on 4.2.7p153 using threads.
 (4.2.7p153) 2011/04/16 Released by Harlan Stenn <stenn at ntp.org>
 * A few more Coverity Scan cleanups.
 (4.2.7p152) 2011/04/15 Released by Harlan Stenn <stenn at ntp.org>

==== libntp/work_thread.c ====
2011-04-16 18:14:12+00:00, davehart at shiny.ad.hartbrothers.com +4 -3
  [Bug 1887] DNS fails on 4.2.7p153 using threads.

--- 1.8/libntp/work_thread.c	2011-04-15 15:53:03 -04:00
+++ 1.9/libntp/work_thread.c	2011-04-16 14:14:12 -04:00
@@ -203,13 +203,15 @@ send_blocking_req_internal(
 	)
 {
 	blocking_pipe_header *	threadcopy;
+	size_t			payload_octets;
 
 	REQUIRE(hdr != NULL);
 	REQUIRE(data != NULL);
 	DEBUG_REQUIRE(BLOCKING_REQ_MAGIC == hdr->magic_sig);
 
-	if (sizeof(*hdr) < hdr->octets)
+	if (hdr->octets <= sizeof(*hdr))
 		return 1;	/* failure */
+	payload_octets = hdr->octets - sizeof(*hdr);
 
 	ensure_workitems_empty_slot(c);
 	if (NULL == c->thread_ref) {
@@ -219,8 +221,7 @@ send_blocking_req_internal(
 
 	threadcopy = emalloc(hdr->octets);
 	memcpy(threadcopy, hdr, sizeof(*hdr));
-	memcpy((char *)threadcopy + sizeof(*hdr),
-	       data, hdr->octets - sizeof(*hdr));
+	memcpy((char *)threadcopy + sizeof(*hdr), data, payload_octets);
 
 	return queue_req_pointer(c, threadcopy);
 }


More information about the bk-ntp-dev-send mailing list