]> git.proxmox.com Git - mirror_zfs.git/commit
zpool_valid_proplist() should not corrupt nvpair name string on error
authorRichard Yao <richard.yao@alumni.stonybrook.edu>
Sat, 11 Mar 2023 20:25:04 +0000 (15:25 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 14 Mar 2023 22:25:40 +0000 (15:25 -0700)
commit47a7062772766c8a532df157a7be681327c20ea6
tree71074552a92fa235a42afddbfde43ab79894b569
parent27ff18cd43aae787fc74780044d0e2189d6e3d33
zpool_valid_proplist() should not corrupt nvpair name string on error

The strings returned from parsing nvlists should be immutable, but to
simplify the code when we want a substring from it, we sometimes will
write a NULL into it and then restore the value afterward. Provided
there is no concurrent access, this is okay, unless we forget to restore
the value afterward. This was caught when constifying string functions
related to nvlists.

Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14612
lib/libzfs/libzfs_pool.c