[PATCH v6 09/18] eal: avoid format overflow when handling addresses

Stephen Hemminger
2025-12-23T18:15:26Z

The largest possible string in this code 0xFFFFFFFFFFFFFFFF
which will overflow with only 15 character buffer.
Increase to 20.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/eal/common/eal_common_memory.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c
index c62edf5e55..2633857db5 100644
--- a/lib/eal/common/eal_common_memory.c
+++ b/lib/eal/common/eal_common_memory.c
@@ -1153,7 +1153,7 @@ rte_eal_memory_init(void)
#define EAL_MEMSEG_INFO_REQ "/eal/memseg_info"
#define EAL_ELEMENT_LIST_REQ "/eal/mem_element_list"
#define EAL_ELEMENT_INFO_REQ "/eal/mem_element_info"
-#define ADDR_STR 15
+#define ADDR_STR 20 /* 16 bytes 64 bit + 0x */

/* Telemetry callback handler to return heap stats for requested heap id. */
--
2.51.0