Ticket #328 (closed defect: fixed)

Opened 12 years ago

Last modified 12 years ago

Possible alignment error in DNS encoding

Reported by: bennylp Owned by: bennylp
Priority: normal Milestone: release-0.8.0
Component: pjlib-util Version: trunk
Keywords: Cc:
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.

Change History

comment:1 Changed 12 years ago by bennylp

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in r1355

Note: See TracTickets for help on using tickets.