diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-01-15 23:56:38 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-01-15 23:56:38 +0000 |
commit | 093d71762c9a80cccdd759c83731c014b53c4435 (patch) | |
tree | 5cd8454691ac044b68fa144ae51fa539664dbc45 /src/tools/tor-resolve.c | |
parent | 11ed4500ded3270ea376d75269200bb99574026e (diff) | |
download | tor-093d71762c9a80cccdd759c83731c014b53c4435.tar.gz tor-093d71762c9a80cccdd759c83731c014b53c4435.zip |
r11978@Kushana: nickm | 2007-01-15 18:54:25 -0500
Apparently, the OpenBSD linker thinks it knows C better than I do, and gets to call me names for having strcat and strcpy and sprintf in my code--whether I use them safely or not. All right, OpenBSD. You win... this round.
svn:r9360
Diffstat (limited to 'src/tools/tor-resolve.c')
-rw-r--r-- | src/tools/tor-resolve.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/tor-resolve.c b/src/tools/tor-resolve.c index 416b01ede6..f24bff497b 100644 --- a/src/tools/tor-resolve.c +++ b/src/tools/tor-resolve.c @@ -66,8 +66,8 @@ build_socks_resolve_request(char **out, (*out)[1] = '\xF0'; /* Command: resolve. */ set_uint16((*out)+2, htons(0)); /* port: 0. */ set_uint32((*out)+4, htonl(0x00000001u)); /* addr: 0.0.0.1 */ - strcpy((*out)+8, username); - strcpy((*out)+8+strlen(username)+1, hostname); + memcpy((*out)+8, username, strlen(username)+1); + memcpy((*out)+8+strlen(username)+1, hostname, strlen(hostname)+1); } else if (version == 5) { int is_ip_address; struct in_addr in; |