diff --git a/bin/tests/system/checkconf/bad-duration.conf b/bin/tests/system/checkconf/bad-duration.conf new file mode 100644 index 0000000000..1fbecc7229 --- /dev/null +++ b/bin/tests/system/checkconf/bad-duration.conf @@ -0,0 +1,16 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +dnssec-policy "test" { + dnskey-ttl xPT1H; +}; diff --git a/lib/isccfg/duration.c b/lib/isccfg/duration.c index 30d110ab0a..0a7501b022 100644 --- a/lib/isccfg/duration.c +++ b/lib/isccfg/duration.c @@ -61,10 +61,10 @@ isccfg_duration_fromtext(isc_textregion_t *source, duration->unlimited = false; /* Every duration starts with 'P' */ - P = strpbrk(str, "Pp"); - if (P == NULL) { + if (toupper(str[0]) != 'P') { return (ISC_R_BADNUMBER); } + P = str; /* Record the time indicator. */ T = strpbrk(str, "Tt");