about summary refs log tree commit diff
path: root/resolv/res_nameinquery.c
diff options
context:
space:
mode:
authorJohn David Anglin <danglin@gcc.gnu.org>2023-09-13 11:04:41 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2023-09-13 11:04:41 +0000
commitc8fa383f4cec9cf1c0cc8ec97903c09af10286f4 (patch)
tree05943f7253316c5dd623c945e8159e6b7b52e00f /resolv/res_nameinquery.c
parent72511f539cc34681ec61c6a0dc2fe6d684760ffe (diff)
downloadglibc-c8fa383f4cec9cf1c0cc8ec97903c09af10286f4.tar.gz
glibc-c8fa383f4cec9cf1c0cc8ec97903c09af10286f4.tar.xz
glibc-c8fa383f4cec9cf1c0cc8ec97903c09af10286f4.zip
resolv: Fix some unaligned accesses in resolver [BZ #30750]
Signed-off-by: John David Anglin <dave.anglin@bell.net>
Diffstat (limited to 'resolv/res_nameinquery.c')
-rw-r--r--resolv/res_nameinquery.c3
1 files changed, 2 insertions, 1 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)
     {