summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-12-12 18:34:22 +0000
committerNick Mathewson <nickm@torproject.org>2006-12-12 18:34:22 +0000
commit9fa707f5d3402a81604984c434756655bf1b6592 (patch)
tree77de7b47df7887dd82796f2b42ffb1f746dc39a6
parent5f68850383fffb01fa17a7d00a7605fd2aa01133 (diff)
downloadtor-9fa707f5d3402a81604984c434756655bf1b6592.tar.gz
tor-9fa707f5d3402a81604984c434756655bf1b6592.zip
r11552@Kushana: nickm | 2006-12-12 13:34:13 -0500
fix a signed/unsigned comparison in eventdns.c svn:r9092
-rw-r--r--src/or/eventdns.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/eventdns.c b/src/or/eventdns.c
index 343b10d567..b36aee1351 100644
--- a/src/or/eventdns.c
+++ b/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;