diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2011-10-26 16:49:24 +0200 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2011-10-26 16:49:24 +0200 |
commit | 34f12437d42bf8cf04763e851b54d6a96470e288 (patch) | |
tree | d92d784c73ff42ce4371bffe093a1a5d405d5d84 /src/or/config.c | |
parent | 03fea3ae91281c8146e5a577e18ef46e81eb6e49 (diff) | |
download | tor-34f12437d42bf8cf04763e851b54d6a96470e288.tar tor-34f12437d42bf8cf04763e851b54d6a96470e288.tar.gz |
Fix a couple of pluggable transport bugs
Fix coverity complaints 490, 491 and 492. Especially the one in
parse_client_transport_line() could've been a remotely triggerable
segfault, I think.
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/or/config.c b/src/or/config.c index 40ce25878..ec9d84b37 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -4865,8 +4865,10 @@ parse_client_transport_line(const char *line, int validate_only) done: SMARTLIST_FOREACH(items, char*, s, tor_free(s)); smartlist_free(items); - SMARTLIST_FOREACH(transport_list, char*, s, tor_free(s)); - smartlist_free(transport_list); + if (transport_list) { + SMARTLIST_FOREACH(transport_list, char*, s, tor_free(s)); + smartlist_free(transport_list); + } return r; } @@ -5989,7 +5991,7 @@ validate_transports_in_state(or_state_t *state) for (line = state->TransportProxies ; line ; line = line->next) { tor_assert(!strcmp(line->key, "TransportProxy")); - if (!state_transport_line_is_valid(line->value)<0) + if (!state_transport_line_is_valid(line->value)) broken = 1; } |