]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
scan-build: sizeof(ptr*) in a debugging log in ext_orport.c
authorNick Mathewson <nickm@torproject.org>
Sat, 19 Apr 2014 16:53:57 +0000 (12:53 -0400)
committerNick Mathewson <nickm@torproject.org>
Sat, 19 Apr 2014 16:53:57 +0000 (12:53 -0400)
Instead of taking the length of a buffer, we were taking the length of
a pointer, so that our debugging log would cover only the first
sizeof(void*) bytes of the client nonce.

src/or/ext_orport.c

index d5a0fa1ee4071acd752fc905007e2eccafa8e0e0..0d28a9199a17e7b0931d09fd22f9c9945798a509 100644 (file)
@@ -256,7 +256,7 @@ handle_client_auth_nonce(const char *client_nonce, size_t client_nonce_len,
     base16_encode(server_nonce_encoded, sizeof(server_nonce_encoded),
                   server_nonce, sizeof(server_nonce));
     base16_encode(client_nonce_encoded, sizeof(client_nonce_encoded),
-                  client_nonce, sizeof(client_nonce));
+                  client_nonce, EXT_OR_PORT_AUTH_NONCE_LEN);
 
     log_debug(LD_GENERAL,
               "server_hash: '%s'\nserver_nonce: '%s'\nclient_nonce: '%s'",