Ticket #328 (closed defect: fixed)
Possible alignment error in DNS encoding
|Reported by:||bennylp||Owned by:||bennylp|
|Backport to 1.x milestone:||Backported:|
When creating DNS query packet, the pj_dns_make_query() function typecasts the packet buffer into pj_dns_hdr struct and write 16bit values to it. This will raise alignment error when the buffer is not 16bit aligned.
Also changed various pj_ntohs() to pj_htons() and char* to pj_uint8_t* for packet buffer, for better semantics.