]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a dumb C bug in the unit tests for 9841
authorNick Mathewson <nickm@torproject.org>
Wed, 9 Apr 2014 13:20:25 +0000 (09:20 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 9 Apr 2014 13:20:25 +0000 (09:20 -0400)
Fixes bug 11460; bug only affects unit tests and is not in any
released version of Tor.

src/test/test_circuitlist.c

index 54c0c03ca3953282f9d2fcc488a4567326a2f8af..53cd41591f625f38d7b86e317fb7adcf3ff16bdd 100644 (file)
@@ -177,7 +177,10 @@ test_rend_token_maps(void *arg)
   c3 = or_circuit_new(0, NULL);
   c4 = or_circuit_new(0, NULL);
 
-  tt_int_op(strlen((char*)tok1), ==, REND_TOKEN_LEN);
+  /* Make sure we really filled up the tok* variables */
+  tt_int_op(tok1[REND_TOKEN_LEN-1], ==, 'y');
+  tt_int_op(tok2[REND_TOKEN_LEN-1], ==, ' ');
+  tt_int_op(tok3[REND_TOKEN_LEN-1], ==, '.');
 
   /* No maps; nothing there. */
   tt_ptr_op(NULL, ==, circuit_get_rendezvous(tok1));