]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a couple of pluggable transport bugs
authorSebastian Hahn <sebastian@torproject.org>
Wed, 26 Oct 2011 14:49:24 +0000 (16:49 +0200)
committerSebastian Hahn <sebastian@torproject.org>
Wed, 26 Oct 2011 14:49:24 +0000 (16:49 +0200)
Fix coverity complaints 490, 491 and 492. Especially the one in
parse_client_transport_line() could've been a remotely triggerable
segfault, I think.

src/or/config.c

index 40ce258780b9ee83c88b0318d1ac29bd542ace3d..ec9d84b374915e0712a579fe5bab7deb23495d92 100644 (file)
@@ -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;
   }