]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a segfault in pt/protocol test
authorNick Mathewson <nickm@torproject.org>
Tue, 8 May 2012 13:37:43 +0000 (09:37 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 8 May 2012 13:38:56 +0000 (09:38 -0400)
Now that the pt code logs mp->argv[0] all over the place, we need to
be sure to set up mp->argv in our tests.

Bugfix on e603692adcd, not in any released version.

src/test/test_pt.c

index 9d6aa09f0d286efa0066fdd8c2ee700388c90681..201f78ea50e0c4adfc13150a99d96a396d596548 100644 (file)
@@ -94,6 +94,8 @@ test_pt_protocol(void)
   managed_proxy_t *mp = tor_malloc_zero(sizeof(managed_proxy_t));
   mp->conf_state = PT_PROTO_LAUNCHED;
   mp->transports = smartlist_new();
+  mp->argv = tor_malloc_zero(sizeof(char*)*2);
+  mp->argv[0] = tor_strdup("<testcase>");
 
   /* various wrong protocol runs: */