summaryrefslogtreecommitdiff
path: root/src/or/buffers.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2010-09-20 18:40:32 -0400
committerRoger Dingledine <arma@torproject.org>2010-09-20 18:40:32 -0400
commit47b23bd03e005c7a86ddd1dbcba619c1840a3232 (patch)
treea01b52445785e4df256241c3de76c496fe4481c1 /src/or/buffers.c
parentff5ffd17760379612b1204fa4de9ab1e6980aac9 (diff)
downloadtor-47b23bd03e005c7a86ddd1dbcba619c1840a3232.tar.gz
tor-47b23bd03e005c7a86ddd1dbcba619c1840a3232.zip
A start at a patch for bug 1943 (alignment issues)
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r--src/or/buffers.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c
index e8422637cd..09ccb7cb0d 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -1498,8 +1498,8 @@ fetch_from_buf_socks(buf_t *buf, socks_request_t *req,
return -1;
}
- req->port = ntohs(*(uint16_t*)(buf->head->data+2));
- destip = ntohl(*(uint32_t*)(buf->head->data+4));
+ req->port = ntohs(get_uint16(buf->head->data+2));
+ destip = ntohl(get_uint32(buf->head->data+4));
if ((!req->port && req->command!=SOCKS_COMMAND_RESOLVE) || !destip) {
log_warn(LD_APP,"socks4: Port or DestIP is zero. Rejecting.");
return -1;