Skip to content

Commit

Permalink
fix numtrunc in str2wire.c
Browse files Browse the repository at this point in the history
  • Loading branch information
headshog committed Jul 11, 2023
1 parent 7240ecb commit 221a792
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sldns/rrdef.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,8 +702,10 @@ 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);
assert(a <= LDNS_RR_TYPE_LAST);
return a;
}

/* Normal types */
for (i = 0; i < (unsigned int) LDNS_RDATA_FIELD_DESCRIPTORS_COUNT; i++) {
Expand Down

0 comments on commit 221a792

Please sign in to comment.