diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2017-02-03 13:01:00 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2017-02-03 13:01:00 +0000 |
commit | c6342fe2e90510d8d2296423f2ca92818a7b3d18 (patch) | |
tree | 0cc9064980c804a7bf5cc6d96c9249950c7e56a9 /dname.c | |
parent | 65be028f32ed37dce84f6328d4a7172132c8c224 (diff) |
Notes
Diffstat (limited to 'dname.c')
-rw-r--r-- | dname.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -87,7 +87,7 @@ ldns_dname_cat_clone(const ldns_rdf *rd1, const ldns_rdf *rd2) } ldns_status -ldns_dname_cat(ldns_rdf *rd1, ldns_rdf *rd2) +ldns_dname_cat(ldns_rdf *rd1, const ldns_rdf *rd2) { uint16_t left_size; uint16_t size; @@ -251,6 +251,9 @@ ldns_dname_new(uint16_t s, void *d) { ldns_rdf *rd; + if (!s || !d) { + return NULL; + } rd = LDNS_MALLOC(ldns_rdf); if (!rd) { return NULL; @@ -527,10 +530,11 @@ ldns_dname_str_absolute(const char *dname_str) for(s=dname_str; *s; s++) { if(*s == '\\') { if(s[1] && s[2] && s[3] /* check length */ - && isdigit(s[1]) && isdigit(s[2]) && - isdigit(s[3])) + && isdigit((unsigned char)s[1]) + && isdigit((unsigned char)s[2]) + && isdigit((unsigned char)s[3])) s += 3; - else if(!s[1] || isdigit(s[1])) /* escape of nul,0-9 */ + else if(!s[1] || isdigit((unsigned char)s[1])) /* escape of nul,0-9 */ return 0; /* parse error */ else s++; /* another character escaped */ } |