]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
fabrics: fix invalid memory access in discover_from_conf_file()
authorMartin Wilck <mwilck@suse.com>
Fri, 5 Mar 2021 22:51:31 +0000 (23:51 +0100)
committerMartin Wilck <mwilck@suse.com>
Tue, 30 Mar 2021 15:46:22 +0000 (17:46 +0200)
commit415b1e1d5a9ec5600909b2e3fabfdcc1c8eb0077
tree435a682910befbb075069788e2b6a7033afed00d
parent2272ca4fa9f885046c555559946b14d345db983c
fabrics: fix invalid memory access in discover_from_conf_file()

argconfig_parse() assigns pointers in cfg to point to memory allocated
in all_args. If this memory is freed, these pointers become dangling.
This is particularly dangerous if discovery.conf contains empty lines,
comment lines, or invalid lines.

Fix it by setting all transport parameter to NULL after processing each
line, and not proceeding if the basic parameters aren't set.
fabrics.c