Explorar o código

Fix bug found by "ca": looking up a non-existent stream for a v1 control connection would cause a segfault. (No backport needed since 0.1.0 had only v0 connections.)

svn:r5001
Nick Mathewson %!s(int64=20) %!d(string=hai) anos
pai
achega
63dfe2447e
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/or/control.c

+ 1 - 1
src/or/control.c

@@ -599,7 +599,7 @@ get_stream(const char *id)
   if (!ok)
     return NULL;
   conn = connection_get_by_global_id(n_id);
-  if (conn->type != CONN_TYPE_AP)
+  if (!conn || conn->type != CONN_TYPE_AP)
     return NULL;
   return conn;
 }