From dfabb3fee36756d6ceab58bc7f28f330640c78dc Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Thu, 31 Jul 2025 13:46:49 +0200 Subject: [PATCH] xenalyze: correct symbol name length fscanf() specifier SYMBOL_NAME_SIZE is 124, not 128. Use the symbolic name there as well, to avoid any disconnect. While there correct indentation on the following line as well. Coverity ID: 1659391 Signed-off-by: Jan Beulich Reviewed-by: Alejandro Vallejo Acked-by: Anthony PERARD --- tools/xentrace/xenalyze.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c index 1c13682aaa..876d59d42c 100644 --- a/tools/xentrace/xenalyze.c +++ b/tools/xentrace/xenalyze.c @@ -321,11 +321,10 @@ void parse_symbol_file(char *fn) { (*p)->next=NULL; } - /* FIXME -- use SYMBOL_NAME_SIZE */ /* FIXME -- use regexp. This won't work for symbols with spaces (yes they exist) */ (*p)->symbols[(*p)->count].addr = 0xDEADBEEF; - if ( fscanf(symbol_file, "%llx %128s", - &(*p)->symbols[(*p)->count].addr, + if ( fscanf(symbol_file, "%llx %" STR(SYMBOL_NAME_SIZE) "s", + &(*p)->symbols[(*p)->count].addr, (*p)->symbols[(*p)->count].name) == 0 ) break;