]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: qedi: Fix truncation of CHAP name and secret
authorAndrew Vasquez <andrew.vasquez@cavium.com>
Wed, 7 Feb 2018 16:12:35 +0000 (08:12 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 14 Feb 2018 02:35:39 +0000 (21:35 -0500)
commit0f31825bbefbae2887706c860964604ffd6642f4
tree1010454f842fd744423801b10697d4b867f7e88d
parent9f33768ef7705917d012984e66880d420bcd3451
scsi: qedi: Fix truncation of CHAP name and secret

The data in NVRAM is not guaranteed to be NUL terminated.  Since
snprintf expects byte-stream to accommodate null byte, the CHAP secret
is truncated.  Use sprintf instead of snprintf to fix the truncation of
CHAP name and secret.

Signed-off-by: Andrew Vasquez <andrew.vasquez@cavium.com>
Signed-off-by: Nilesh Javali <nilesh.javali@cavium.com>
Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
Acked-by: Chris Leech <cleech@redhat.com>
Acked-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qedi/qedi_main.c