mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-01-06 23:09:35 -05:00
fix numtrunc in str2wire.c
This commit is contained in:
parent
7240ecbeb0
commit
78c284e05d
1 changed files with 10 additions and 2 deletions
|
|
@ -702,7 +702,11 @@ sldns_get_rr_type_by_name(const char *name)
|
|||
|
||||
/* TYPEXX representation */
|
||||
if (strlen(name) > 4 && strncasecmp(name, "TYPE", 4) == 0) {
|
||||
return atoi(name + 4);
|
||||
unsigned int a = atoi(name + 4);
|
||||
if (a > LDNS_RR_TYPE_LAST) {
|
||||
return (enum sldns_enum_rr_type)0;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
/* Normal types */
|
||||
|
|
@ -740,7 +744,11 @@ sldns_get_rr_class_by_name(const char *name)
|
|||
|
||||
/* CLASSXX representation */
|
||||
if (strlen(name) > 5 && strncasecmp(name, "CLASS", 5) == 0) {
|
||||
return atoi(name + 5);
|
||||
unsigned int a = atoi(name + 5);
|
||||
if (a > LDNS_RR_TYPE_LAST) {
|
||||
return (enum sldns_enum_rr_type)0;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
/* Normal types */
|
||||
|
|
|
|||
Loading…
Reference in a new issue