public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: John David Anglin <danglin@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] resolv: Fix some unaligned accesses in resolver [BZ #30750]
Date: Wed, 13 Sep 2023 11:05:33 +0000 (GMT) [thread overview]
Message-ID: <20230913110533.A0EAF3858D20@sourceware.org> (raw)
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c8fa383f4cec9cf1c0cc8ec97903c09af10286f4
commit c8fa383f4cec9cf1c0cc8ec97903c09af10286f4
Author: John David Anglin <danglin@gcc.gnu.org>
Date: Wed Sep 13 11:04:41 2023 +0000
resolv: Fix some unaligned accesses in resolver [BZ #30750]
Signed-off-by: John David Anglin <dave.anglin@bell.net>
Diff:
---
resolv/res_nameinquery.c | 3 ++-
resolv/res_queriesmatch.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/resolv/res_nameinquery.c b/resolv/res_nameinquery.c
index 24172700e1..ca56bc9283 100644
--- a/resolv/res_nameinquery.c
+++ b/resolv/res_nameinquery.c
@@ -84,6 +84,7 @@
#include <arpa/nameser.h>
#include <resolv.h>
+#include <resolv/resolv-internal.h>
/* Author: paul vixie, 29may94. */
int
@@ -91,7 +92,7 @@ __libc_res_nameinquery (const char *name, int type, int class,
const unsigned char *buf, const unsigned char *eom)
{
const unsigned char *cp = buf + HFIXEDSZ;
- int qdcount = ntohs (((HEADER *) buf)->qdcount);
+ int qdcount = ntohs (((UHEADER *) buf)->qdcount);
while (qdcount-- > 0)
{
diff --git a/resolv/res_queriesmatch.c b/resolv/res_queriesmatch.c
index 13a6936c47..ba1c1d0c0c 100644
--- a/resolv/res_queriesmatch.c
+++ b/resolv/res_queriesmatch.c
@@ -83,6 +83,7 @@
*/
#include <resolv.h>
+#include <resolv/resolv-internal.h>
/* Author: paul vixie, 29may94. */
int
@@ -102,7 +103,7 @@ __libc_res_queriesmatch (const unsigned char *buf1, const unsigned char *eom1,
order. We can compare it with the second buffer's QDCOUNT
value without doing this. */
int qdcount = ((HEADER *) buf1)->qdcount;
- if (qdcount != ((HEADER *) buf2)->qdcount)
+ if (qdcount != ((UHEADER *) buf2)->qdcount)
return 0;
qdcount = htons (qdcount);
reply other threads:[~2023-09-13 11:05 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230913110533.A0EAF3858D20@sourceware.org \
--to=danglin@sourceware.org \
--cc=glibc-cvs@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).