diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-05-07 15:22:17 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-05-15 10:03:10 -0400 |
commit | f2a6eedded9d4dc3c854c1e3091d1f6278ac6e7f (patch) | |
tree | 2194e4ba1b85ee34309faeca594b85d8acbb74d5 /src/or | |
parent | f6afd4efa6c24fab8ace710fc0eac4c8811b93dd (diff) | |
download | tor-f2a6eedded9d4dc3c854c1e3091d1f6278ac6e7f.tar.gz tor-f2a6eedded9d4dc3c854c1e3091d1f6278ac6e7f.zip |
Fix a crash bug on SETCIRCUITPURPOSE.
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/control.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/control.c b/src/or/control.c index ddfc80e8fd..b41b291061 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -2389,6 +2389,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); |