From: David VaĊĦek Date: Mon, 3 Apr 2023 22:14:49 +0000 (+0200) Subject: kdig: be careful about the received EDNS EXPIRE value X-Git-Tag: v3.4.dev~166 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=779b5938c7ca090e644f1fe45844f610a2b4fd0d;p=thirdparty%2Fknot-dns.git kdig: be careful about the received EDNS EXPIRE value --- diff --git a/src/utils/common/exec.c b/src/utils/common/exec.c index afe026fa78..dfecd9af80 100644 --- a/src/utils/common/exec.c +++ b/src/utils/common/exec.c @@ -278,8 +278,11 @@ static void print_expire(const uint8_t *data, uint16_t len) } else { char str[80] = ""; uint32_t timer = knot_wire_read_u32(data); - knot_time_print_human(timer, str, sizeof(str), false); - printf("%u (%s)", timer, str); + if (knot_time_print_human(timer, str, sizeof(str), false) > 0) { + printf("%u (%s)", timer, str); + } else { + printf("%u", timer); + } } }