diff options
author | Roger Dingledine <arma@torproject.org> | 2014-09-21 01:23:39 -0400 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2014-09-21 16:05:24 -0400 |
commit | 1b40ea036fa6e0c4063e096ccc52d47c1227710f (patch) | |
tree | 811b630e2798aa02e011e46613908832c29adbba /src | |
parent | e170205cd8aae085687ca3b166bcc38b2134fc22 (diff) | |
download | tor-1b40ea036fa6e0c4063e096ccc52d47c1227710f.tar.gz tor-1b40ea036fa6e0c4063e096ccc52d47c1227710f.zip |
Stop silently skipping invalid args to setevents
Return an error when the second or later arguments of the
"setevents" controller command are invalid events. Previously we
would return success while silently skipping invalid events.
Fixes bug 13205; bugfix on 0.2.3.2-alpha. Reported by "fpxnns".
Diffstat (limited to 'src')
-rw-r--r-- | src/or/control.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/control.c b/src/or/control.c index 7038b2cfd5..df694930bd 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -949,7 +949,7 @@ static int handle_control_setevents(control_connection_t *conn, uint32_t len, const char *body) { - int event_code = -1; + int event_code; event_mask_t event_mask = 0; smartlist_t *events = smartlist_new(); @@ -963,6 +963,8 @@ handle_control_setevents(control_connection_t *conn, uint32_t len, continue; } else { int i; + event_code = -1; + for (i = 0; control_event_table[i].event_name != NULL; ++i) { if (!strcasecmp(ev, control_event_table[i].event_name)) { event_code = control_event_table[i].event_code; |