2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-28 21:17:54 +00:00

Fix a bug in the duration_fromtext function

The function actually did not enforce that the duration string starts
with a P (or p), just that there is a P (or p) in the string.

(cherry picked from commit 8e18fa5874226600198138c098a437275cd31557)
This commit is contained in:
Matthijs Mekking 2022-06-24 09:58:40 +02:00
parent 8af88d4111
commit feaf3950fd
2 changed files with 18 additions and 2 deletions

View File

@ -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;
};

View File

@ -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");