Merge branch 'develop' of github.com:getdnsapi/getdns into develop

This commit is contained in:
Willem Toorop 2019-02-04 15:46:46 +01:00
commit 97ac5d3ddc
7 changed files with 9 additions and 8 deletions

View File

@ -55,6 +55,7 @@ typedef unsigned short in_port_t;
#include <sys/stat.h> #include <sys/stat.h>
#include <string.h> #include <string.h>
#include <strings.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -1670,7 +1670,7 @@ getdns_str2dict(const char *str, getdns_dict **dict)
if (!str || !dict) if (!str || !dict)
return GETDNS_RETURN_INVALID_PARAMETER; return GETDNS_RETURN_INVALID_PARAMETER;
while (*str && isspace(*str)) while (*str && isspace((unsigned char)*str))
str++; str++;
if (*str != '{') { if (*str != '{') {

View File

@ -67,7 +67,7 @@ typedef struct _getdns_tls_connection {
const getdns_log_config* log; const getdns_log_config* log;
#if defined(USE_DANESSL) #if defined(USE_DANESSL)
const char* auth_name; const char* auth_name;
sha256_pin_t* pinset; const sha256_pin_t* pinset;
#endif #endif
} _getdns_tls_connection; } _getdns_tls_connection;

View File

@ -904,7 +904,7 @@ getdns_return_t _getdns_tls_connection_set_host_pinset(_getdns_tls_connection* c
if (!conn || !conn->ssl || !auth_name) if (!conn || !conn->ssl || !auth_name)
return GETDNS_RETURN_INVALID_PARAMETER; return GETDNS_RETURN_INVALID_PARAMETER;
#if defined(USE_DANE_SSL) #if defined(USE_DANESSL)
/* Stash auth name and pinset away for use in cert verification. */ /* Stash auth name and pinset away for use in cert verification. */
conn->auth_name = auth_name; conn->auth_name = auth_name;
conn->pinset = pinset; conn->pinset = pinset;

View File

@ -98,7 +98,7 @@ static int get_rrtype(const char *t)
if (strlen(t) > sizeof(buf) - 15) if (strlen(t) > sizeof(buf) - 15)
return -1; return -1;
for (i = 14; *t && i < sizeof(buf) - 1; i++, t++) for (i = 14; *t && i < sizeof(buf) - 1; i++, t++)
buf[i] = *t == '-' ? '_' : toupper(*t); buf[i] = *t == '-' ? '_' : toupper((unsigned char)*t);
buf[i] = '\0'; buf[i] = '\0';
if (!getdns_str2int(buf, &rrtype)) if (!getdns_str2int(buf, &rrtype))
@ -123,7 +123,7 @@ static int get_rrclass(const char *t)
if (strlen(t) > sizeof(buf) - 16) if (strlen(t) > sizeof(buf) - 16)
return -1; return -1;
for (i = 15; *t && i < sizeof(buf) - 1; i++, t++) for (i = 15; *t && i < sizeof(buf) - 1; i++, t++)
buf[i] = toupper(*t); buf[i] = toupper((unsigned char)*t);
buf[i] = '\0'; buf[i] = '\0';
if (!getdns_str2int(buf, &rrclass)) if (!getdns_str2int(buf, &rrclass))

View File

@ -130,7 +130,7 @@ static int get_rrtype(const char *t)
if (strlen(t) > sizeof(buf) - 15) if (strlen(t) > sizeof(buf) - 15)
return -1; return -1;
for (i = 14; *t && i < sizeof(buf) - 1; i++, t++) for (i = 14; *t && i < sizeof(buf) - 1; i++, t++)
buf[i] = *t == '-' ? '_' : toupper(*t); buf[i] = *t == '-' ? '_' : toupper((unsigned char)*t);
buf[i] = '\0'; buf[i] = '\0';
if (!getdns_str2int(buf, &rrtype)) if (!getdns_str2int(buf, &rrtype))

View File

@ -1428,9 +1428,9 @@ _getdns_validate_dname(const char* dname) {
break; break;
case '\\': case '\\':
s += 1; s += 1;
if (isdigit(s[0])) { if (isdigit((unsigned char)s[0])) {
/* octet value */ /* octet value */
if (! isdigit(s[1]) && ! isdigit(s[2])) if (! isdigit((unsigned char)s[1]) && ! isdigit((unsigned char)s[2]))
return GETDNS_RETURN_BAD_DOMAIN_NAME; return GETDNS_RETURN_BAD_DOMAIN_NAME;
if ((s[0] - '0') * 100 + if ((s[0] - '0') * 100 +