Whamcloud - gitweb
LU-19140 utils: sep in yaml_fill_scalar_data can be '\0' 65/59965/2
authorJames Simmons <jsimmons@infradead.org>
Fri, 27 Jun 2025 19:53:24 +0000 (15:53 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 8 Jul 2025 03:53:50 +0000 (03:53 +0000)
commit509a3f560a16f9d3643667d89843faec5c054428
treedc555a76cefec45958b182de9df6709164596b8a
parent3cc1223e1235992286a0b647d00b799fba05fdd6
LU-19140 utils: sep in yaml_fill_scalar_data can be '\0'

While testing lnetctl import a corner case bug was exposed. For
yaml_fill_scalar_data() the variable sep can be set to '\0' which
when later we can strchr to find the newline will fail since it
thinks its already at the end of the string. Instead do the
search for the newline after sep has restored ':' at its start
and skipped the whitespaces.

Test-Parameters: trivial testlist=sanity-lnet
Fixes: 8f64231185a ("LU-9680 utils: fix nested attribute handling in liblnetconfig")
Change-Id: Ibcf03616777feca58599d816265947f6de27c5b8
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/59965
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Frank Sehr <fsehr@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lnet/utils/lnetconfig/liblnetconfig_netlink.c