mirror of
https://github.com/RetroShare/BitDHT.git
synced 2026-09-12 19:50:02 +05:00
added compile option to use sanitizer and already fixed a few misalignment errors with it
This commit is contained in:
parent
a777b09f44
commit
32e2e1a862
@ -827,9 +827,10 @@ int decodeCompactPeerId(struct sockaddr_in *addr, char *enc, int len)
|
||||
|
||||
memset(addr, 0, sizeof(struct sockaddr_in));
|
||||
|
||||
uint32_t *ip = (uint32_t *) (enc);
|
||||
//uint32_t *ip = (uint32_t *) (enc);
|
||||
uint16_t *port = (uint16_t *) (&enc[4]);
|
||||
addr->sin_addr.s_addr = (*ip);
|
||||
|
||||
memcpy(& addr->sin_addr.s_addr, enc, sizeof(in_addr_t)); // aligned version of "addr->sin_addr.s_addr = (*ip); "
|
||||
addr->sin_port = (*port);
|
||||
addr->sin_family = AF_INET;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user