mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-25 23:45:49 -04:00
added compile option to use sanitizer and already fixed a few misalignment errors with it
This commit is contained in:
parent
941df6120a
commit
6a18e242bb
8 changed files with 35 additions and 12 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue