]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Don't init control authchallenge nonce as assert side effect
authorSebastian Hahn <sebastian@torproject.org>
Thu, 12 Mar 2015 17:56:48 +0000 (18:56 +0100)
committerSebastian Hahn <sebastian@torproject.org>
Thu, 12 Mar 2015 17:57:57 +0000 (18:57 +0100)
Fixes part of bug 15211.

changes/bug15211
src/or/control.c

index b99e61ef1137d21c08d3939e260c68e4f86e1901..b14f5cb6f007bbac6abea375f58780cf67260dbc 100644 (file)
@@ -1,5 +1,5 @@
   o Minor bugfixes:
     - Remove side-effects from tor_assert() calls. This was harmless,
       because we never disable assertions, but it is bad style and
-      unnecessary. Fixes bug 15211; bugfix on 0.2.5.5.
+      unnecessary. Fixes bug 15211; bugfix on 0.2.5.5, 0.2.2.36.
 
index e25c3b2954533813d710832fa484d21ebd0267c1..819a57f21451690c98e9cc4f443962b6844b16f5 100644 (file)
@@ -3102,8 +3102,8 @@ handle_control_authchallenge(control_connection_t *conn, uint32_t len,
     tor_free(client_nonce);
     return -1;
   }
-
-  tor_assert(!crypto_rand(server_nonce, SAFECOOKIE_SERVER_NONCE_LEN));
+  int fail = crypto_rand(server_nonce, SAFECOOKIE_SERVER_NONCE_LEN);
+  tor_assert(!fail);
 
   /* Now compute and send the server-to-controller response, and the
    * server's nonce. */