diff options
| author | Sam Varshavchik | 2021-05-21 21:11:51 -0400 |
|---|---|---|
| committer | Sam Varshavchik | 2021-05-21 21:11:51 -0400 |
| commit | 142f42378608e593eb36ceb33895db99948427aa (patch) | |
| tree | fc089285268a8fe3c8768cd7482fb50393f49354 /rfc1035 | |
| parent | 34b6dbb743654fdb6edccf101c4da7e671b7a92d (diff) | |
| download | courier-libs-142f42378608e593eb36ceb33895db99948427aa.tar.bz2 | |
-Wall and -Werror fixes
Diffstat (limited to 'rfc1035')
| -rw-r--r-- | rfc1035/configure.ac | 29 | ||||
| -rw-r--r-- | rfc1035/rfc1035.h | 4 | ||||
| -rw-r--r-- | rfc1035/testlookup.c | 9 |
3 files changed, 30 insertions, 12 deletions
diff --git a/rfc1035/configure.ac b/rfc1035/configure.ac index ca692c9..84b731c 100644 --- a/rfc1035/configure.ac +++ b/rfc1035/configure.ac @@ -32,7 +32,7 @@ then fi dnl Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS(sys/types.h sys/time.h unistd.h arpa/inet.h netinet/in.h strings.h) +AC_CHECK_HEADERS(sys/types.h sys/time.h unistd.h arpa/inet.h netinet/in.h strings.h stdint.h) USENSL=no saveLIBS="$LIBS" @@ -88,8 +88,11 @@ AC_ARG_WITH(int32, #if HAVE_SYS_TYPES_H #include <sys/types.h> #endif +#if HAVE_STDINT_H +#include <stdint.h> +#endif +uint32_t n; ],[ - (void)(uint32_t)0; ], [ AC_MSG_RESULT(yes) ; int32="uint32_t"], [ AC_MSG_RESULT(no) @@ -99,8 +102,11 @@ AC_ARG_WITH(int32, #if HAVE_SYS_TYPES_H #include <sys/types.h> #endif +#if HAVE_STDINT_H +#include <stdint.h> +#endif +u_int32_t n; ],[ - (void)(u_int32_t)0; ], [AC_MSG_RESULT(yes); int32="u_int32_t"],[ AC_MSG_RESULT(no) @@ -139,8 +145,11 @@ AC_ARG_WITH(int16, #if HAVE_SYS_TYPES_H #include <sys/types.h> #endif +#if HAVE_STDINT_H +#include <stdint.h> +#endif +uint16_t n; ],[ - (void)(uint16_t)0; ], [ AC_MSG_RESULT(yes) ; int16="uint16_t"], [ AC_MSG_RESULT(no) @@ -150,8 +159,11 @@ AC_ARG_WITH(int16, #if HAVE_SYS_TYPES_H #include <sys/types.h> #endif +#if HAVE_STDINT_H +#include <stdint.h> +#endif +u_int16_t n; ],[ - (void)(u_int16_t)0; ], [AC_MSG_RESULT(yes); int16="u_int16_t"],[ AC_MSG_RESULT(no) @@ -255,9 +267,9 @@ AC_TRY_COMPILE( [ #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> -] , [ struct in6_addr in6a; +] , [ in6a.s6_addr16 $LB 0 $RB =0; in6a.s6_addr32 $LB 0 $RB =0; ], @@ -268,9 +280,9 @@ AC_TRY_COMPILE( [ #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> +struct in6_addr in6a; ], [ -struct in6_addr in6a; in6a.__u6_addr.__u6_addr16 $LB 0 $RB =0; in6a.__u6_addr.__u6_addr32 $LB 0 $RB =0; @@ -282,10 +294,9 @@ AC_TRY_COMPILE( [ #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> - - ], [ struct in6_addr in6a; + ], [ in6a._S6_un._S6_u8 $LB 0 $RB = 0; in6a._S6_un._S6_u32 $LB 0 $RB = 0; diff --git a/rfc1035/rfc1035.h b/rfc1035/rfc1035.h index 9a92c1b..3c802e0 100644 --- a/rfc1035/rfc1035.h +++ b/rfc1035/rfc1035.h @@ -21,7 +21,9 @@ #if HAVE_NETINET_IN_H #include <netinet/in.h> #endif - +#if HAVE_STDINT_H +#include <stdint.h> +#endif #ifdef __cplusplus extern "C" { #endif diff --git a/rfc1035/testlookup.c b/rfc1035/testlookup.c index 75c701f..869e806 100644 --- a/rfc1035/testlookup.c +++ b/rfc1035/testlookup.c @@ -312,8 +312,13 @@ char ptrbuf[RFC1035_MAXNAMESIZE+1]; { char namebuf[RFC1035_MAXNAMESIZE+1]; - namebuf[0]=0; - strncat(namebuf, q_name, RFC1035_MAXNAMESIZE); + size_t l=strlen(q_name); + + if (l > RFC1035_MAXNAMESIZE) + l=RFC1035_MAXNAMESIZE; + + memcpy(namebuf, q_name, l); + namebuf[l]=0; if (rfc1035_resolve_cname_multiple(&res, namebuf, q_type, q_class, |
