aboutsummaryrefslogtreecommitdiff
path: root/src/or/buffers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r--src/or/buffers.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c
index 65b77e06e..8dc8df1f6 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -483,7 +483,8 @@ int fetch_from_buf_socks(buf_t *buf, socks_request_t *req) {
}
memcpy(req->address,buf->mem+5,len);
req->address[len] = 0;
- req->port = ntohs(*(uint16_t*)(buf->mem+5+len));
+ memcpy(&req->port, buf->mem+5+len, 2);
+ req->port = ntohs(req->port);
buf_remove_from_front(buf, 5+len+2);
return 1;
default: /* unsupported */