summaryrefslogtreecommitdiff
path: root/src/tools/tor-resolve.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/tor-resolve.c')
-rw-r--r--src/tools/tor-resolve.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tools/tor-resolve.c b/src/tools/tor-resolve.c
index 328c74e4c9..3eebb57a6e 100644
--- a/src/tools/tor-resolve.c
+++ b/src/tools/tor-resolve.c
@@ -237,18 +237,18 @@ do_resolve(const char *hostname, uint32_t sockshost, uint16_t socksport,
}
*result_addr = ntohl(get_uint32(reply_buf));
} else if (reply_buf[3] == 3) {
- size_t len;
+ size_t result_len;
if (read_all(s, reply_buf, 1, 1) != 1) {
log_err(LD_NET, "Error reading address_length in socks5 response.");
return -1;
}
- len = *(uint8_t*)(reply_buf);
- *result_hostname = tor_malloc(len+1);
- if (read_all(s, *result_hostname, len, 1) != (int) len) {
+ result_len = *(uint8_t*)(reply_buf);
+ *result_hostname = tor_malloc(result_len+1);
+ if (read_all(s, *result_hostname, result_len, 1) != (int) result_len) {
log_err(LD_NET, "Error reading hostname in socks5 response.");
return -1;
}
- (*result_hostname)[len] = '\0';
+ (*result_hostname)[result_len] = '\0';
}
}