[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen stable-4.19] xenalyze: correct symbol name length fscanf() specifier
commit a592800e5ee350c41e06db2a5b986cbf76ea6adc Author: Jan Beulich <jbeulich@xxxxxxxx> AuthorDate: Mon Aug 4 15:22:58 2025 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Mon Aug 4 15:22:58 2025 +0200 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 <jbeulich@xxxxxxxx> Reviewed-by: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx> Acked-by: Anthony PERARD <anthony.perard@xxxxxxxxxx> master commit: dfabb3fee36756d6ceab58bc7f28f330640c78dc master date: 2025-07-31 14:44:02 +0200 --- tools/firmware/hvmloader/util.h | 3 --- tools/include/xen-tools/common-macros.h | 3 +++ tools/xentrace/xenalyze.c | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.h index deb823a892..7206c793ed 100644 --- a/tools/firmware/hvmloader/util.h +++ b/tools/firmware/hvmloader/util.h @@ -21,9 +21,6 @@ enum { /* Cause xs_wire.h to give us xsd_errors[]. */ #define EINVAL EINVAL -#define __STR(...) #__VA_ARGS__ -#define STR(...) __STR(__VA_ARGS__) - /* GDT selector values. */ #define SEL_CODE16 0x0008 #define SEL_DATA16 0x0010 diff --git a/tools/include/xen-tools/common-macros.h b/tools/include/xen-tools/common-macros.h index 60912225cb..0088208c2e 100644 --- a/tools/include/xen-tools/common-macros.h +++ b/tools/include/xen-tools/common-macros.h @@ -88,6 +88,9 @@ (type *)((char *)mptr__ - offsetof(type, member)); \ }) +#define __STR(...) #__VA_ARGS__ +#define STR(...) __STR(__VA_ARGS__) + #define __AC(X, Y) (X ## Y) #define _AC(X, Y) __AC(X, Y) 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; -- generated by git-patchbot for /home/xen/git/xen.git#stable-4.19
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |