1
0
mirror of https://frontier.innolan.net/rainlance/c-ares.git synced 2025-10-05 18:42:01 +00:00

cleanup: avoid unsafe typecasts

Avoid the risk of reading 16bit data from an unaligned address by using
a macro that is adapted for this.
This commit is contained in:
Daniel Stenberg
2010-12-18 22:20:16 +01:00
parent 70b726c334
commit 2d5ed6400b
2 changed files with 5 additions and 5 deletions

View File

@ -47,7 +47,7 @@
int
ares_parse_mx_reply (const unsigned char *abuf, int alen,
struct ares_mx_reply **mx_out)
struct ares_mx_reply **mx_out)
{
unsigned int qdcount, ancount, i;
const unsigned char *aptr, *vptr;
@ -134,7 +134,7 @@ ares_parse_mx_reply (const unsigned char *abuf, int alen,
mx_last = mx_curr;
vptr = aptr;
mx_curr->priority = ntohs (*((unsigned short *)vptr));
mx_curr->priority = DNS__16BIT(vptr);
vptr += sizeof(unsigned short);
status = ares_expand_name (vptr, abuf, alen, &mx_curr->host, &len);