libata: transport: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Wed, 11 Mar 2020 07:11:00 +0000 (08:11 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 12 Mar 2020 13:38:47 +0000 (07:38 -0600)
commita900cc5cd846edc6964736834e098e88d7ecfcd6
treef99463cc1a76303de4583420096b05ad1841a927
parent2c523b344dfa65a3738e7039832044aa133c75fb
libata: transport: 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().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/ata/libata-transport.c