mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 13:13:44 +01:00
r11552@Kushana: nickm | 2006-12-12 13:34:13 -0500
fix a signed/unsigned comparison in eventdns.c svn:r9092
This commit is contained in:
parent
5f68850383
commit
9fa707f5d3
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user