[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r9092: fix a signed/unsigned comparison in eventdns.c (in tor/trunk: . src/or)



Author: nickm
Date: 2006-12-12 13:34:22 -0500 (Tue, 12 Dec 2006)
New Revision: 9092

Modified:
   tor/trunk/
   tor/trunk/src/or/eventdns.c
Log:
 r11552@Kushana:  nickm | 2006-12-12 13:34:13 -0500
 fix a signed/unsigned comparison in eventdns.c



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r11552] on c95137ef-5f19-0410-b913-86e773d04f59

Modified: tor/trunk/src/or/eventdns.c
===================================================================
--- tor/trunk/src/or/eventdns.c	2006-12-12 06:08:07 UTC (rev 9091)
+++ tor/trunk/src/or/eventdns.c	2006-12-12 18:34:22 UTC (rev 9092)
@@ -1476,7 +1476,7 @@
 		if (!name) {
 			const unsigned int label_len = end - start;
 			if (label_len > 63) return -1;
-			if (j+label_len+1 > buf_len) return -2;
+			if ((size_t)(j+label_len+1) > buf_len) return -2;
 			if (table) dnslabel_table_add(table, start, j);
 			buf[j++] = label_len;
 
@@ -1487,7 +1487,7 @@
 			// append length of the label.
 			const unsigned int label_len = name - start;
 			if (label_len > 63) return -1;
-			if (j+label_len+1 > buf_len) return -2;
+			if ((size_t)(j+label_len+1) > buf_len) return -2;
 			if (table) dnslabel_table_add(table, start, j);
 			buf[j++] = label_len;