🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by Stephen Hemminger Mon, 09 Nov 2026 18:08
[PATCH iproute2] lib: do not truncate 64 bit size in json
#13364
Author: Stephen Hemminger
Date: Mon, 09 Nov 2026 18:08
33 lines
11560 bytes
print_color_size() takes a 64 bit size but it gets truncated
when printing json.

Reported-by: Anthropic OSS scanner (ANT-2026-H0R4ZJSS)
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/json_print_math.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/json_print_math.c b/lib/json_print_math.c
index 3e951cd9..85c29d6c 100644
--- a/lib/json_print_math.c
+++ b/lib/json_print_math.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 
 #include <stdarg.h>
+#include <inttypes.h>
 #include <stdio.h>
 #include <math.h>
 
@@ -33,7 +34,7 @@ int print_color_size(enum output_type type, enum color_attr color,
 	SPRINT_BUF(buf);
 
 	if (_IS_JSON_CONTEXT(type))
-		return print_color_uint(type, color, key, "%u", sz);
+		return print_color_u64(type, color, key, "%"PRIu64, sz);
 
 	sprint_size(sz, buf);
 	return print_color_string(type, color, key, fmt, buf);
-- 
2.53.0
Re: [PATCH iproute2] lib: do not truncate 64 bit size in json
#14330
Author: patchwork-bot+netdevbpf
Date: Wed, 11 Nov 2026 00:00
24 lines
8482 bytes
Hello:

This patch was applied to iproute2/iproute2.git (main)
by Stephen Hemminger <stephen@networkplumber.org>:

On Mon,  9 Nov 2026 10:08:46 -0800 you wrote:
> print_color_size() takes a 64 bit size but it gets truncated
> when printing json.
> 
> Reported-by: Anthropic OSS scanner (ANT-2026-H0R4ZJSS)
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  lib/json_print_math.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Here is the summary with links:
  - [iproute2] lib: do not truncate 64 bit size in json
    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=6582d89d02bf

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads