]> www.infradead.org Git - users/sagi/libnvme.git/commit
fabrics: Avoid out of bounds string chomping
authorDaniel Wagner <dwagner@suse.de>
Wed, 23 Mar 2022 14:49:38 +0000 (15:49 +0100)
committerDaniel Wagner <dwagner@suse.de>
Wed, 23 Mar 2022 14:54:51 +0000 (15:54 +0100)
commit0290a4b1ebf72209cf186ffecd84fcfcbd223e91
tree12d13de0874bb1fc180b39db21f2db49f1d6cdab
parentc8f247233597f1ba59093d9e6f608dac0b4ff0ec
fabrics: Avoid out of bounds string chomping

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>
src/nvme/fabrics.c
src/nvme/fabrics.h