diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-05-15 10:05:19 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-05-15 10:05:19 -0400 |
commit | 521cb581877be404626446aa558cade649c13f03 (patch) | |
tree | 8b4278b981f71932ee18469ae859d09659b4dac2 | |
parent | 92cba63459c0b3cac59f6daa75506a967e515907 (diff) | |
parent | 5905a0b2dbcff8bd07e179750f53a8f010b4a5e0 (diff) | |
download | tor-521cb581877be404626446aa558cade649c13f03.tar.gz tor-521cb581877be404626446aa558cade649c13f03.zip |
Merge remote-tracking branch 'origin/maint-0.2.2'
-rw-r--r-- | changes/bug5796 | 4 | ||||
-rw-r--r-- | src/or/control.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/changes/bug5796 b/changes/bug5796 new file mode 100644 index 0000000000..b92659f74a --- /dev/null +++ b/changes/bug5796 @@ -0,0 +1,4 @@ + o Minor bugfixes (controller): + - Fix a NULL-pointer derefernce on a badly formed + SETCIRCUITPURPOSE command. Found by mikeyc. Fixes bug 5796; + bugfix on 0.2.2.9-alpha. diff --git a/src/or/control.c b/src/or/control.c index 976997dcf0..ec018ffc23 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -2530,6 +2530,10 @@ handle_control_setcircuitpurpose(control_connection_t *conn, { const char *purp = find_element_starting_with(args,1,"PURPOSE="); + if (!purp) { + connection_write_str_to_buf("552 No purpose given\r\n", conn); + goto done; + } new_purpose = circuit_purpose_from_string(purp); if (new_purpose == CIRCUIT_PURPOSE_UNKNOWN) { connection_printf_to_buf(conn, "552 Unknown purpose \"%s\"\r\n", purp); |