]> git.ipfire.org Git - thirdparty/glibc.git/commit
resolv: Fix unaligned accesses to fields in HEADER struct
authorJohn David Anglin <danglin@gcc.gnu.org>
Tue, 22 Mar 2022 17:35:54 +0000 (17:35 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Tue, 22 Mar 2022 17:35:54 +0000 (17:35 +0000)
commit05dec22d7be722987ff07aebf9690f6078b3c4e9
tree35a3443eabdceb4081450ac2869cd84dc5fcbc6b
parentbc0d18d873abf2cda6842ad8bb4df2a31dc0fbac
resolv: Fix unaligned accesses to fields in HEADER struct

The structure HEADER is normally aligned to a word boundary but
sometimes it needs to be accessed when aligned on a byte boundary.
This change defines a new typedef, UHEADER, with alignment 1.
It is used to ensure the fields are accessed with byte loads and
stores when necessary.

V4: Change to res_mkquery.c deleted.  Small whitespace fix.

V5: Move UHEADER typedef to resolv/resolv-internal.h.  Replace all
HEADER usage with UHEADER in resolv/res_send.c.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
resolv/res_query.c
resolv/res_send.c
resolv/resolv-internal.h