From 87f2733d536c1858bf5661f0eccf819acd064345 Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Thu, 30 Mar 2023 13:10:23 +0300 Subject: [PATCH] LU-16684 utils: reset buf_len in print_out_devices() so that print_out_devices() doesn't hit false buffer overflow leading to missing devices in lctl device_list output. Fixes: ba0d5ffc1c ("LU-9680 utils: new llapi_param_display_value().") Signed-off-by: Alex Zhuravlev Change-Id: Ia0ebbd0150651d7c631348201c26ea8b3d1ff704 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50475 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin Reviewed-by: Mikhail Pershin Reviewed-by: James Simmons Reviewed-by: Andreas Dilger --- lustre/utils/liblustreapi_param.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lustre/utils/liblustreapi_param.c b/lustre/utils/liblustreapi_param.c index a1f52ca..a027850 100644 --- a/lustre/utils/liblustreapi_param.c +++ b/lustre/utils/liblustreapi_param.c @@ -449,6 +449,7 @@ static int print_out_devices(yaml_parser_t *reply, enum lctl_param_flags flags) } bzero(buf, sizeof(buf)); tmp = buf; + buf_len = sizeof(buf); } if (event.type == YAML_SCALAR_EVENT) { -- 1.8.3.1