diff options
author | Roger Dingledine <arma@torproject.org> | 2004-03-20 09:30:30 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-03-20 09:30:30 +0000 |
commit | 66f878513f1aa62c14984eddad32c6a3c7b26025 (patch) | |
tree | eddaf299cda394bea7b5ffb23c9e9b0732ea8941 /src/or/buffers.c | |
parent | 2ba2f0218130731e46fed9cc565d0b802d4f4a31 (diff) | |
download | tor-66f878513f1aa62c14984eddad32c6a3c7b26025.tar tor-66f878513f1aa62c14984eddad32c6a3c7b26025.tar.gz |
deal with hardware word alignment
this was causing the seg faults on sparc processors
i wonder if i got them all.
svn:r1314
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r-- | src/or/buffers.c | 3 |
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 */ |