Skip to content
Commit fc039ce8 authored by Ludwig Rydberg's avatar Ludwig Rydberg Committed by Florian Weimer
Browse files

resolv: Fix a few unaligned accesses to fields in HEADER



After refactoring the alloca usage in 40c0add7 ("resolve: Remove
__res_context_query alloca usage") a few unaligned accesses to HEADER
fields surfaced. These unaligned accesses led to problems when running
the resolv test suite on sparc32-linux (leon) as many tests failed due to
SIGBUS crashes.

The issue(s) occured during T_QUERY_A_AND_AAAA queries as the second query
now can start on an unaligned address (previously it was explicitly aligned).

With this patch the unaligned accesses are now fixed by using the
UHEADER instead to ensure the fields are accessed with byte
loads/stores.

The patch has been verfied by running the resolv test suite on sparc32
and x86_64.

Signed-off-by: default avatarLudwig Rydberg <ludwig.rydberg@gaisler.com>
Signed-off-by: default avatarAndreas Larsson <andreas@gaisler.com>
Reviewed-by: default avatarFlorian Weimer <fweimer@redhat.com>
parent 4753e928
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment