Re: [PATCH] scsi: ibmvscsi: Improve strings handling

2018-07-02 Thread Martin K. Petersen
Breno, > Currently an open firmware property is copied into partition_name > variable without keeping a room for \0. > > Later one, this variable (partition_name), which is 97 bytes long, is > strncpyed into ibmvcsci_host_data->madapter_info->partition_name, > which is 96 bytes long, possibly

Re: [PATCH] scsi: ibmvscsi: Improve strings handling

2018-06-26 Thread Tyrel Datwyler
On 06/26/2018 01:35 PM, Breno Leitao wrote: The subject line should have been updated to [PATCH v2] to clue recipients to the fact that this is an updated version and not a resend or accidental duplicate send. > Currently an open firmware property is copied into partition_name variable >

[PATCH] scsi: ibmvscsi: Improve strings handling

2018-06-26 Thread Breno Leitao
Currently an open firmware property is copied into partition_name variable without keeping a room for \0. Later one, this variable (partition_name), which is 97 bytes long, is strncpyed into ibmvcsci_host_data->madapter_info->partition_name, which is 96 bytes long, possibly truncating it 'again'

Re: [PATCH] scsi: ibmvscsi: Improve strings handling

2018-06-26 Thread Bart Van Assche
On 06/26/18 12:10, Breno Leitao wrote: if (ppartition_name) strncpy(partition_name, ppartition_name, - sizeof(partition_name)); + sizeof(partition_name) - 1); Please use strlcpy() instead of trying to emulate

[PATCH] scsi: ibmvscsi: Improve strings handling

2018-06-26 Thread Breno Leitao
Currently an open firmware property is copied into partition_name variable without keeping a room for \0. Later one, this variable (partition_name), which is 97 bytes long, is strncpyed into ibmvcsci_host_data->madapter_info->partition_name, which is 96 bytes long, possibly truncating it 'again'