Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP4:Update
libnvme.26914
0022-fabrics-Duplicate-strings-when-merging-con...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0022-fabrics-Duplicate-strings-when-merging-configs.patch of Package libnvme.26914
From: Daniel Wagner <dwagner@suse.de> Date: Fri, 28 Oct 2022 16:42:21 +0200 Subject: fabrics: Duplicate strings when merging configs Git-commit d187b21add042f941436f94d5dc75bb566f9fe3d References: bsc#1205019 We have to use strdup here, because the merged config will be freeing these pointers eventually. Without it, we are going to double free it. Signed-off-by: Daniel Wagner <dwagner@suse.de> --- src/nvme/fabrics.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nvme/fabrics.c b/src/nvme/fabrics.c index 7c2b371140c7..a501f7900c5f 100644 --- a/src/nvme/fabrics.c +++ b/src/nvme/fabrics.c @@ -191,13 +191,15 @@ void nvmf_default_config(struct nvme_fabrics_config *cfg) #define MERGE_CFG_OPTION(c, n, o, d) \ if ((c)->o == d) (c)->o = (n)->o +#define MERGE_CFG_OPTION_STR(c, n, o, d) \ + if ((c)->o == d && (n)->o) (c)->o = strdup((n)->o) static struct nvme_fabrics_config *merge_config(nvme_ctrl_t c, const struct nvme_fabrics_config *cfg) { struct nvme_fabrics_config *ctrl_cfg = nvme_ctrl_get_config(c); - MERGE_CFG_OPTION(ctrl_cfg, cfg, host_traddr, NULL); - MERGE_CFG_OPTION(ctrl_cfg, cfg, host_iface, NULL); + MERGE_CFG_OPTION_STR(ctrl_cfg, cfg, host_traddr, NULL); + MERGE_CFG_OPTION_STR(ctrl_cfg, cfg, host_iface, NULL); MERGE_CFG_OPTION(ctrl_cfg, cfg, nr_io_queues, 0); MERGE_CFG_OPTION(ctrl_cfg, cfg, nr_write_queues, 0); MERGE_CFG_OPTION(ctrl_cfg, cfg, nr_poll_queues, 0); -- 2.38.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor