Skip to content

fabrics: Avoid out of bounds string chomping#310

Merged
igaw merged 1 commit intolinux-nvme:masterfrom
igaw:nvme_chomp
Mar 24, 2022
Merged

fabrics: Avoid out of bounds string chomping#310
igaw merged 1 commit intolinux-nvme:masterfrom
igaw:nvme_chomp

Conversation

@igaw
Copy link
Copy Markdown
Collaborator

@igaw igaw commented Mar 23, 2022

Update all callsides of nvme_chomp to use the correct max lenght of
the string to avoid out of bounds access.

While at it, nvme_chomp() is used by fabrics.c to sanitize the traddr
and trsvcid. There is no user outside of fabrics and clearly this is a
small helper function. Thus move it to fabrics and rename it to a more
comon name strchomp.

Signed-off-by: Daniel Wagner dwagner@suse.de

Fixes: #305

Update all callsides of nvme_chomp to use the correct max lenght of
the string to avoid out of bounds access.

While at it, nvme_chomp() is used by fabrics.c to sanitize the traddr
and trsvcid. There is no user outside of fabrics and clearly this is a
small helper function. Thus move it to fabrics and rename it to a more
comon name strchomp.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
@igaw igaw merged commit 61caac8 into linux-nvme:master Mar 24, 2022
@igaw igaw deleted the nvme_chomp branch March 24, 2022 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nvme_chomp() does not remove trailing spaces

2 participants