summaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-08-04 12:03:31 -0400
committerNick Mathewson <nickm@torproject.org>2011-08-04 12:03:31 -0400
commit8054e81e14e20101e355a7c58d7e5ea7ec231d96 (patch)
tree3db5f4f56472bde91ede35ff196c29f037e85a28 /src/or/or.h
parent6596aa022f03bad34a3ee9cbd627fefe55c01d54 (diff)
downloadtor-8054e81e14e20101e355a7c58d7e5ea7ec231d96.tar.gz
tor-8054e81e14e20101e355a7c58d7e5ea7ec231d96.zip
Treat socks_request->{username,password} as non-NUL-terminated
They *are* non-NUL-terminated, after all (and they have to be, since the SOCKS5 spec allows them to contain embedded NULs. But the code to implement proposal 171 was copying them with tor_strdup and comparing them with strcmp_opt. Fix for bug on 3683; bug not present in any yet-released version.
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/or.h b/src/or/or.h
index 150971b5fb..e7670bb530 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -2524,6 +2524,10 @@ typedef struct origin_circuit_t {
char *dest_address;
int session_group;
unsigned nym_epoch;
+ uint8_t socks_username_len;
+ uint8_t socks_password_len;
+ /* Note that the next two values are NOT NUL-terminated; see
+ socks_username_len and socks_password_len for their lengths. */
char *socks_username;
char *socks_password;
/**@}*/