For #909: Numeric truncation when parsing TYPEXX and CLASSXX representation

- Fix return values.
- Formatting nits.
This commit is contained in:
George Thessalonikefs
2023-07-20 11:42:05 +02:00
parent d29bc712b1
commit 5b7faca7db
4 changed files with 17 additions and 10 deletions
+7 -4
View File
@@ -226,12 +226,15 @@ make_query(char* qname, char* qtype, char* qclass)
printf("cannot parse query name: '%s'\n", qname);
exit(1);
}
qinfo.qtype = sldns_get_rr_type_by_name(qtype);
if(qinfo.qtype == 0 && strcmp(qtype, "TYPE0") != 0) {
printf("cannot parse query type: '%s'\n", qtype);
exit(1);
}
qinfo.qclass = sldns_get_rr_class_by_name(qclass);
if((qinfo.qtype == 0 && strcmp(qtype, "TYPE0") != 0) ||
(qinfo.qclass == 0 && strcmp(qclass, "CLASS0") != 0)) {
return 0;
if(qinfo.qclass == 0 && strcmp(qclass, "CLASS0") != 0) {
printf("cannot parse query class: '%s'\n", qclass);
exit(1);
}
qinfo.local_alias = NULL;