Ver código fonte

r11552@Kushana: nickm | 2006-12-12 13:34:13 -0500
fix a signed/unsigned comparison in eventdns.c


svn:r9092

Nick Mathewson 19 anos atrás
pai
commit
9fa707f5d3
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      src/or/eventdns.c

+ 2 - 2
src/or/eventdns.c

@@ -1476,7 +1476,7 @@ dnsname_to_labels(u8 *const buf, size_t buf_len, off_t j,
 		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 @@ dnsname_to_labels(u8 *const buf, size_t buf_len, off_t j,
 			// 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;