diff options
author | Petr Menšík <pemensik@redhat.com> | 2021-09-03 16:41:00 +0200 |
---|---|---|
committer | Simon Kelley <simon@thekelleys.org.uk> | 2021-09-11 21:36:01 +0100 |
commit | fc522515b9a45fb710364a24acadbc7e7591ad00 (patch) | |
tree | 43bdd2ce933e146143eba5a2696f1e41cc92a282 | |
parent | 9881b0736d9bd6244c880aee76346c9ac9580317 (diff) | |
download | dnsmasq-fc522515b9a45fb710364a24acadbc7e7591ad00.tar.gz |
Fix coverity formats issues in blockdata
Error: PRINTF_ARGS (CWE-686): [#def16]
dnsmasq-2.86test7/src/blockdata.c:56: invalid_type: Argument "blockdata_count * 48UL" to format specifier "%u" was expected to have type "unsigned int" but has type "unsigned long".
# 54| {
# 55| my_syslog(LOG_INFO, _("pool memory in use %u, max %u, allocated %u"),
# 56|-> blockdata_count * sizeof(struct blockdata),
# 57| blockdata_hwm * sizeof(struct blockdata),
# 58| blockdata_alloced * sizeof(struct blockdata));
Error: PRINTF_ARGS (CWE-686): [#def17]
dnsmasq-2.86test7/src/blockdata.c:57: invalid_type: Argument "blockdata_hwm * 48UL" to format specifier "%u" was expected to have type "unsigned int" but has type "unsigned long".
# 55| my_syslog(LOG_INFO, _("pool memory in use %u, max %u, allocated %u"),
# 56| blockdata_count * sizeof(struct blockdata),
# 57|-> blockdata_hwm * sizeof(struct blockdata),
# 58| blockdata_alloced * sizeof(struct blockdata));
# 59| }
Error: PRINTF_ARGS (CWE-686): [#def18]
dnsmasq-2.86test7/src/blockdata.c:58: invalid_type: Argument "blockdata_alloced * 48UL" to format specifier "%u" was expected to have type "unsigned int" but has type "unsigned long".
# 56| blockdata_count * sizeof(struct blockdata),
# 57| blockdata_hwm * sizeof(struct blockdata),
# 58|-> blockdata_alloced * sizeof(struct blockdata));
# 59| }
# 60|
-rw-r--r-- | src/blockdata.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/blockdata.c b/src/blockdata.c index f7740b5..0986285 100644 --- a/src/blockdata.c +++ b/src/blockdata.c @@ -52,7 +52,7 @@ void blockdata_init(void) void blockdata_report(void) { - my_syslog(LOG_INFO, _("pool memory in use %u, max %u, allocated %u"), + my_syslog(LOG_INFO, _("pool memory in use %zu, max %zu, allocated %zu"), blockdata_count * sizeof(struct blockdata), blockdata_hwm * sizeof(struct blockdata), blockdata_alloced * sizeof(struct blockdata)); |