[PATCH v2 1/3] xen/cmdline: fix printf format specifier in no_config_param()

Roger Pau Monne posted 3 patches 1 year, 11 months ago
There is a newer version of this series
[PATCH v2 1/3] xen/cmdline: fix printf format specifier in no_config_param()
Posted by Roger Pau Monne 1 year, 11 months ago
'*' sets the width field, which is the minimum number of characters to output,
but what we want in no_config_param() is the precision instead, which is '.*'
as it imposes a maximum limit on the output.

Fixes: 68d757df8dd2 ('x86/pv: Options to disable and/or compile out 32bit PV support')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Changes since v1:
 - New in this version.
---
 xen/include/xen/param.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/xen/param.h b/xen/include/xen/param.h
index 9170455cde5c..6442a92aff8e 100644
--- a/xen/include/xen/param.h
+++ b/xen/include/xen/param.h
@@ -191,7 +191,7 @@ static inline void no_config_param(const char *cfg, const char *param,
 {
     int len = e ? ({ ASSERT(e >= s); e - s; }) : strlen(s);
 
-    printk(XENLOG_INFO "CONFIG_%s disabled - ignoring '%s=%*s' setting\n",
+    printk(XENLOG_INFO "CONFIG_%s disabled - ignoring '%s=%.*s' setting\n",
            cfg, param, len, s);
 }
 
-- 
2.43.0


Re: [PATCH v2 1/3] xen/cmdline: fix printf format specifier in no_config_param()
Posted by Jan Beulich 1 year, 11 months ago
On 23.02.2024 13:06, Roger Pau Monne wrote:
> '*' sets the width field, which is the minimum number of characters to output,
> but what we want in no_config_param() is the precision instead, which is '.*'
> as it imposes a maximum limit on the output.
> 
> Fixes: 68d757df8dd2 ('x86/pv: Options to disable and/or compile out 32bit PV support')
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>