diff --git a/lib/dns/dnssec.c b/lib/dns/dnssec.c index b5ed301b94..e395a8806d 100644 --- a/lib/dns/dnssec.c +++ b/lib/dns/dnssec.c @@ -1411,7 +1411,6 @@ dns_dnssec_findmatchingkeys2(dns_name_t *origin, const char *directory, isc_stdtime_t now, isc_mem_t *mctx, dns_dnsseckeylist_t *keylist) { - const char *digits = "0123456789"; isc_result_t result = ISC_R_SUCCESS; isc_boolean_t dir_open = ISC_FALSE; dns_dnsseckeylist_t list; @@ -1445,11 +1444,10 @@ dns_dnssec_findmatchingkeys2(dns_name_t *origin, const char *directory, alg = 0; for (i = len + 1 + 1; i < dir.entry.length ; i++) { - const char *digit = strchr(digits, dir.entry.name[i]); - if (digit == NULL) + if (dir.entry.name[i] < '0' || dir.entry.name[i] > '9') break; alg *= 10; - alg += (int)(digit - digits); + alg += dir.entry.name[i] - '0'; } /*