]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-fabrics: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Wed, 11 Mar 2020 08:50:37 +0000 (09:50 +0100)
committerKeith Busch <kbusch@kernel.org>
Wed, 25 Mar 2020 19:51:55 +0000 (04:51 +0900)
commit9d7f71edc2d071b2ce36d053dc8c301c422728b4
treecaa01ad16a92349a4344da6e114f49cb484a970f
parentfc58b791f7d33afe7cefc0994e4bafd868ab7c73
nvme-fabrics: Use scnprintf() for avoiding potential buffer overflow

Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit.  Fix it by replacing with scnprintf().

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/fabrics.c