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

Harlan Stenn stenn at whimsy.udel.edu
Thu Jun 28 08:13:07 UTC 2007


#### ChangeSet ####
2007-06-28 04:11:15-04:00, stenn at whimsy.udel.edu 
  More assertion checks and malloc()->emalloc(), courtesy of Calysto

==== ChangeLog ====
2007-06-28 04:10:24-04:00, stenn at whimsy.udel.edu +1 -0
  More assertion checks and malloc()->emalloc(), courtesy of Calysto

--- 1.77/ChangeLog	2007-06-28 04:05:30 -04:00
+++ 1.78/ChangeLog	2007-06-28 04:10:24 -04:00
@@ -1,3 +1,4 @@
+* More assertion checks and malloc()->emalloc(), courtesy of Calysto.
 * [Bug 864] Place ntpd service in maintenance mode if using SMF on Solaris
 * [Bug 862] includefile nesting; preserve phonelist on reconfig.
 * [Bug 604] ntpd regularly dies on linux/alpha.

==== ntpd/ntp_crypto.c ====
2007-06-28 04:10:27-04:00, stenn at whimsy.udel.edu +6 -1
  More assertion checks and malloc()->emalloc(), courtesy of Calysto

--- 1.110/ntpd/ntp_crypto.c	2007-06-27 02:12:17 -04:00
+++ 1.111/ntpd/ntp_crypto.c	2007-06-28 04:10:27 -04:00
@@ -2006,10 +2006,13 @@ asn2ntp	(
 	char	*v;		/* pointer to ASN1_TIME string */
 	struct	tm tm;		/* used to convert to NTP time */
 
+	NTP_REQUIRE(asn1time != NULL);
+	NTP_REQUIRE(asn1time->data != NULL);
+
 	/*
 	 * Extract time string YYMMDDHHMMSSZ from ASN1 time structure.
 	 * Note that the YY, MM, DD fields start with one, the HH, MM,
-	 * SS fiels start with zero and the Z character should be 'Z'
+	 * SS fields start with zero and the Z character should be 'Z'
 	 * for UTC. Also note that years less than 50 map to years
 	 * greater than 100. Dontcha love ASN.1? Better than MIL-188.
 	 */
@@ -3095,6 +3098,8 @@ cert_parse(
 	cnt = X509_get_ext_count(cert);
 	for (i = 0; i < cnt; i++) {
 		ext = X509_get_ext(cert, i);
+		NTP_INSIST(ext != NULL);
+		NTP_INSIST(ext->value != NULL);
 		method = X509V3_EXT_get(ext);
 		temp = OBJ_obj2nid(ext->object);
 		switch (temp) {

==== ntpd/ntp_data_structures.c ====
2007-06-28 04:10:30-04:00, stenn at whimsy.udel.edu +2 -2
  More assertion checks and malloc()->emalloc(), courtesy of Calysto

--- 1.4/ntpd/ntp_data_structures.c	2007-06-14 18:42:00 -04:00
+++ 1.5/ntpd/ntp_data_structures.c	2007-06-28 04:10:30 -04:00
@@ -23,7 +23,7 @@
 
 queue *create_priority_queue(int (*get_order)(void *, void *))
 {
-    queue *my_queue = (queue *) malloc(sizeof(queue));
+    queue *my_queue = (queue *) emalloc(sizeof(queue));
     my_queue->get_order = get_order;
     my_queue->front = NULL;
     my_queue->no_of_elements = 0;
@@ -59,7 +59,7 @@ void destroy_queue(queue *my_queue)
 void *get_node(size_t size)
 {
     node *new_node;
-    new_node = (node *) malloc(sizeof(node) + size);
+    new_node = (node *) emalloc(sizeof(node) + size);
     if (new_node != NULL) {
         new_node->node_next = NULL; 
         return new_node + 1;


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