From 31473ee2864ba18093439d14ef728a111a2a2951 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 15 Jan 2008 05:57:55 +0000 Subject: r17627@catbus: nickm | 2008-01-15 00:57:52 -0500 Backport the user-visible bugfixes from r13136. svn:r13137 --- ChangeLog | 4 ++++ src/or/control.c | 2 +- src/or/routerlist.c | 2 +- 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) -- cgit v1.2.3-54-g00ecf