]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
json_discovery_log: avoid buffer overrun
authorCaleb Sander <csander@purestorage.com>
Thu, 26 Jan 2023 17:53:07 +0000 (10:53 -0700)
committerCaleb Sander <csander@purestorage.com>
Thu, 26 Jan 2023 18:28:45 +0000 (11:28 -0700)
commit91bea49eefd152b2fdb1666dfa253fe808929511
tree0b61b9b2f890512334f98fc7636fdc371e78bdd7
parent2ea98e89e1480e6aa754b808e550a67a8c8eeb94
json_discovery_log: avoid buffer overrun

nvme_strip_spaces() has an off-by-one error and starts stripping spaces
at the byte AFTER the end of the buffer. Use space_strip_len() instead,
which doesn't have this bug and is already used in print_discovery_log().

Signed-off-by: Caleb Sander <csander@purestorage.com>
fabrics.c
nvme.h