[tor-commits] [tor/master] scan-build: sizeof(ptr*) in a debugging log in ext_orport.c

nickm at torproject.org nickm at torproject.org
Fri Apr 25 05:30:23 UTC 2014

commit 78f555a2480b03911e602c2c041a10fd010804b9
Author: Nick Mathewson <nickm at torproject.org>
Date:   Sat Apr 19 12:53:57 2014 -0400

    scan-build: sizeof(ptr*) in a debugging log in ext_orport.c
    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 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/or/ext_orport.c b/src/or/ext_orport.c
index d5a0fa1..0d28a91 100644
--- a/src/or/ext_orport.c
+++ b/src/or/ext_orport.c
@@ -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);
               "server_hash: '%s'\nserver_nonce: '%s'\nclient_nonce: '%s'",

More information about the tor-commits mailing list