diff options
Diffstat (limited to 'src/util/dnsparser.c')
-rw-r--r-- | src/util/dnsparser.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/util/dnsparser.c b/src/util/dnsparser.c index 2baa76ef2..7546ca1e9 100644 --- a/src/util/dnsparser.c +++ b/src/util/dnsparser.c | |||
@@ -25,15 +25,19 @@ | |||
25 | * @author Christian Grothoff | 25 | * @author Christian Grothoff |
26 | */ | 26 | */ |
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #if HAVE_LIBIDN2 | ||
28 | #if HAVE_IDN2_H | 29 | #if HAVE_IDN2_H |
29 | #include <idn2.h> | 30 | #include <idn2.h> |
30 | #elif HAVE_IDN2_IDN2_H | 31 | #elif HAVE_IDN2_IDN2_H |
31 | #include <idn2/idn2.h> | 32 | #include <idn2/idn2.h> |
32 | #elif HAVE_IDNA_H | 33 | #endif |
34 | #elif HAVE_LIBIDN | ||
35 | #if HAVE_IDNA_H | ||
33 | #include <idna.h> | 36 | #include <idna.h> |
34 | #elif HAVE_IDN_IDNA_H | 37 | #elif HAVE_IDN_IDNA_H |
35 | #include <idn/idna.h> | 38 | #include <idn/idna.h> |
36 | #endif | 39 | #endif |
40 | #endif | ||
37 | #if WINDOWS | 41 | #if WINDOWS |
38 | #include <idn-free.h> | 42 | #include <idn-free.h> |
39 | #endif | 43 | #endif |
@@ -1084,12 +1088,19 @@ GNUNET_DNSPARSER_builder_add_cert (char *dst, | |||
1084 | { | 1088 | { |
1085 | struct GNUNET_TUN_DnsCertRecord dcert; | 1089 | struct GNUNET_TUN_DnsCertRecord dcert; |
1086 | 1090 | ||
1091 | #ifdef __clang__ | ||
1092 | #pragma clang diagnostic push | ||
1093 | #pragma clang diagnostic ignored "-Wtautological-constant-out-of-range-compare" | ||
1094 | #endif | ||
1087 | if ( (cert->cert_type > UINT16_MAX) || | 1095 | if ( (cert->cert_type > UINT16_MAX) || |
1088 | (cert->algorithm > UINT8_MAX) ) | 1096 | (cert->algorithm > UINT8_MAX) ) |
1089 | { | 1097 | { |
1090 | GNUNET_break (0); | 1098 | GNUNET_break (0); |
1091 | return GNUNET_SYSERR; | 1099 | return GNUNET_SYSERR; |
1092 | } | 1100 | } |
1101 | #ifdef __clang__ | ||
1102 | #pragma clang diagnostic pop | ||
1103 | #endif | ||
1093 | if (*off + sizeof (struct GNUNET_TUN_DnsCertRecord) + cert->certificate_size > dst_len) | 1104 | if (*off + sizeof (struct GNUNET_TUN_DnsCertRecord) + cert->certificate_size > dst_len) |
1094 | return GNUNET_NO; | 1105 | return GNUNET_NO; |
1095 | dcert.cert_type = htons ((uint16_t) cert->cert_type); | 1106 | dcert.cert_type = htons ((uint16_t) cert->cert_type); |