bind9/lib
Aram Sargsyan b6978ccbe3 Fix a logical bug in cfg_print_duration()
The cfg_print_duration() function prints a ISO 8601 duration value
converted from an array of integers, where the parts of the date and
time are stored.

durationlen[6], which holds the "seconds" part of the duration, has
a special case in cfg_print_duration() to ensure that when there are
no values in the duration, the result still can be printed as "PT0S",
instead of just "P", so it can be a valid ISO 8601 duration value.

There is a logical error in one of the two special case code paths,
when it checks that no value from the "date" part is defined, and no
"hour" or "minute" from the "time" part are defined.

Because of the error, durationlen[6] can be used uninitialized, in
which case the second parameter passed to snprintf() (which is the
maximum allowed length) can contain a garbage value.

This can not be exploited because the buffer is still big enough to
hold the maximum possible amount of characters generated by the "%u%c"
format string.

Fix the logical bug, and initialize the 'durationlen' array to zeros
to be a little safer from other similar errors.

(cherry picked from commit 9440910187)
2022-10-17 08:52:20 +00:00
..
bind9 Clarify error message about missing inline-signing & dnssec-policy 2022-10-06 10:27:32 +02:00
dns Add support for 'dohpath' to SVCB (and HTTPS) 2022-10-04 15:32:22 +11:00
irs Move all the unit tests to /tests/<libname>/ 2022-05-31 12:06:00 +02:00
isc TLS DNS: fix certificate verification error message reporting 2022-10-12 16:53:06 +03:00
isccc Convert DST_ALG defines to enum and group HMAC algorithms 2022-09-27 16:55:33 +02:00
isccfg Fix a logical bug in cfg_print_duration() 2022-10-17 08:52:20 +00:00
ns BIND 9.18.7 2022-09-21 13:13:30 +02:00
.gitignore The isc/platform.h header has been completely removed 2021-07-06 05:33:48 +00:00
Makefile.am move samples/resolve.c to bin/tests/system 2021-04-16 14:29:43 +02:00