diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-01-18 08:05:12 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-02-13 14:27:31 -0500 |
commit | 703d641d87034629f8b0da94334034ed5d805b36 (patch) | |
tree | 6697505c60330ca106b936797b01d1b793163424 /drivers/target | |
parent | 8f67835f1e389978bb0809d5e528961986aa2a69 (diff) |
target: change sprintf to snprintf in transport_dump_vpd_ident
"buf" is 128 characters and "vpd->device_identifier" is 256. It makes
the static checkers complain.
Also bump VPD_TMP_BUF_SIZE to match INQUIRY_VPD_DEVICE_IDENTIFIER_LEN.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/target_core_transport.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index bd587b70661a..96b64d57ebbb 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
@@ -907,15 +907,18 @@ int transport_dump_vpd_ident( | |||
907 | 907 | ||
908 | switch (vpd->device_identifier_code_set) { | 908 | switch (vpd->device_identifier_code_set) { |
909 | case 0x01: /* Binary */ | 909 | case 0x01: /* Binary */ |
910 | sprintf(buf, "T10 VPD Binary Device Identifier: %s\n", | 910 | snprintf(buf, sizeof(buf), |
911 | "T10 VPD Binary Device Identifier: %s\n", | ||
911 | &vpd->device_identifier[0]); | 912 | &vpd->device_identifier[0]); |
912 | break; | 913 | break; |
913 | case 0x02: /* ASCII */ | 914 | case 0x02: /* ASCII */ |
914 | sprintf(buf, "T10 VPD ASCII Device Identifier: %s\n", | 915 | snprintf(buf, sizeof(buf), |
916 | "T10 VPD ASCII Device Identifier: %s\n", | ||
915 | &vpd->device_identifier[0]); | 917 | &vpd->device_identifier[0]); |
916 | break; | 918 | break; |
917 | case 0x03: /* UTF-8 */ | 919 | case 0x03: /* UTF-8 */ |
918 | sprintf(buf, "T10 VPD UTF-8 Device Identifier: %s\n", | 920 | snprintf(buf, sizeof(buf), |
921 | "T10 VPD UTF-8 Device Identifier: %s\n", | ||
919 | &vpd->device_identifier[0]); | 922 | &vpd->device_identifier[0]); |
920 | break; | 923 | break; |
921 | default: | 924 | default: |