aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-01-15 05:57:55 +0000
committerNick Mathewson <nickm@torproject.org>2008-01-15 05:57:55 +0000
commit31473ee2864ba18093439d14ef728a111a2a2951 (patch)
tree1732a76d75e0d03fd66b02f1f1e33ff7438133dc
parentb7494ce8e925af57e0346cf79b6fea909f6ca6ae (diff)
downloadtor-31473ee2864ba18093439d14ef728a111a2a2951.tar.gz
tor-31473ee2864ba18093439d14ef728a111a2a2951.zip
r17627@catbus: nickm | 2008-01-15 00:57:52 -0500
Backport the user-visible bugfixes from r13136. svn:r13137
-rw-r--r--ChangeLog4
-rw-r--r--src/or/control.c2
-rw-r--r--src/or/routerlist.c2
3 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 2a823e9c7a..44d9aeb44d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -45,6 +45,10 @@ Changes in version 0.1.2.19 - 2008-01-??
the real limit for number of open files is OPEN_FILES, not
rlim_max from getrlimit(RLIMIT_NOFILES).
- Avoid a spurious free on base64 failure.
+ - Avoid segfaults on certain complex invocations of
+ router_get_by_hexdigest()
+ - Fix rare bug on REDIRECTSTREAM control command when called with no
+ port set: it could erroneously report an error when none had happened.
Changes in version 0.1.2.18 - 2007-10-28
diff --git a/src/or/control.c b/src/or/control.c
index a8e58aee4b..2e3f771abb 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -2046,7 +2046,7 @@ handle_control_redirectstream(control_connection_t *conn, uint32_t len,
connection_printf_to_buf(conn, "552 Unknown stream \"%s\"\r\n",
(char*)smartlist_get(args, 0));
} else {
- int ok;
+ int ok = 1;
if (smartlist_len(args) > 2) { /* they included a port too */
new_port = (uint16_t) tor_parse_ulong(smartlist_get(args, 2),
10, 1, 65535, &ok, NULL);
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index fe5587522d..69712519a2 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1494,7 +1494,7 @@ router_get_by_hexdigest(const char *hexdigest)
ri = router_get_by_digest(digest);
- if (len > HEX_DIGEST_LEN) {
+ if (ri && len > HEX_DIGEST_LEN) {
if (hexdigest[HEX_DIGEST_LEN] == '=') {
if (strcasecmp(ri->nickname, hexdigest+HEX_DIGEST_LEN+1) ||
!ri->is_named)