mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: 3w-9xxx.c:  Cleaning up missing null-terminate in conjunction with strncpy
@ 2014-07-27 15:11 Rickard Strandqvist
  2014-07-31 22:19 ` adam radford
  2014-12-30 12:52 ` Christoph Hellwig
  0 siblings, 2 replies; 5+ messages in thread
From: Rickard Strandqvist @ 2014-07-27 15:11 UTC (permalink / raw)
  To: Adam Radford, James E.J. Bottomley
  Cc: Rickard Strandqvist, linux-scsi, linux-kernel

Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
And use the sizeof on the to string rather than strlen on the from string.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/scsi/3w-9xxx.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index 0a73253..f4d2331 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -621,7 +621,8 @@ static int twa_check_srl(TW_Device_Extension *tw_dev, int *flashed)
 	}
 
 	/* Load rest of compatibility struct */
-	strncpy(tw_dev->tw_compat_info.driver_version, TW_DRIVER_VERSION, strlen(TW_DRIVER_VERSION));
+	strlcpy(tw_dev->tw_compat_info.driver_version, TW_DRIVER_VERSION,
+		sizeof(tw_dev->tw_compat_info.driver_version));
 	tw_dev->tw_compat_info.driver_srl_high = TW_CURRENT_DRIVER_SRL;
 	tw_dev->tw_compat_info.driver_branch_high = TW_CURRENT_DRIVER_BRANCH;
 	tw_dev->tw_compat_info.driver_build_high = TW_CURRENT_DRIVER_BUILD;
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: 3w-9xxx.c: Cleaning up missing null-terminate in conjunction with strncpy
  2014-07-27 15:11 [PATCH] scsi: 3w-9xxx.c: Cleaning up missing null-terminate in conjunction with strncpy Rickard Strandqvist
@ 2014-07-31 22:19 ` adam radford
  2014-12-22 22:52   ` Rickard Strandqvist
  2014-12-30 12:52 ` Christoph Hellwig
  1 sibling, 1 reply; 5+ messages in thread
From: adam radford @ 2014-07-31 22:19 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Adam Radford, James E.J. Bottomley, linux-scsi, linux-kernel

On Sun, Jul 27, 2014 at 8:11 AM, Rickard Strandqvist
<rickard_strandqvist@spectrumdigital.se> wrote:
> Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
> And use the sizeof on the to string rather than strlen on the from string.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  drivers/scsi/3w-9xxx.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
> index 0a73253..f4d2331 100644
> --- a/drivers/scsi/3w-9xxx.c
> +++ b/drivers/scsi/3w-9xxx.c
> @@ -621,7 +621,8 @@ static int twa_check_srl(TW_Device_Extension *tw_dev, int *flashed)
>         }
>
>         /* Load rest of compatibility struct */
> -       strncpy(tw_dev->tw_compat_info.driver_version, TW_DRIVER_VERSION, strlen(TW_DRIVER_VERSION));
> +       strlcpy(tw_dev->tw_compat_info.driver_version, TW_DRIVER_VERSION,
> +               sizeof(tw_dev->tw_compat_info.driver_version));
>         tw_dev->tw_compat_info.driver_srl_high = TW_CURRENT_DRIVER_SRL;
>         tw_dev->tw_compat_info.driver_branch_high = TW_CURRENT_DRIVER_BRANCH;
>         tw_dev->tw_compat_info.driver_build_high = TW_CURRENT_DRIVER_BUILD;
> --
> 1.7.10.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

Rickard,

This patch looks fine.

Acked-by: Adam Radford <aradford@gmail.com>

-Adam

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: 3w-9xxx.c: Cleaning up missing null-terminate in conjunction with strncpy
  2014-07-31 22:19 ` adam radford
@ 2014-12-22 22:52   ` Rickard Strandqvist
  2014-12-22 23:08     ` adam radford
  0 siblings, 1 reply; 5+ messages in thread
From: Rickard Strandqvist @ 2014-12-22 22:52 UTC (permalink / raw)
  To: adam radford; +Cc: Adam Radford, James E.J. Bottomley, linux-scsi, linux-kernel

2014-08-01 0:19 GMT+02:00 adam radford <aradford@gmail.com>:
> On Sun, Jul 27, 2014 at 8:11 AM, Rickard Strandqvist
> <rickard_strandqvist@spectrumdigital.se> wrote:
>> Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
>> And use the sizeof on the to string rather than strlen on the from string.
>>
>> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
>> ---
>>  drivers/scsi/3w-9xxx.c |    3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
>> index 0a73253..f4d2331 100644
>> --- a/drivers/scsi/3w-9xxx.c
>> +++ b/drivers/scsi/3w-9xxx.c
>> @@ -621,7 +621,8 @@ static int twa_check_srl(TW_Device_Extension *tw_dev, int *flashed)
>>         }
>>
>>         /* Load rest of compatibility struct */
>> -       strncpy(tw_dev->tw_compat_info.driver_version, TW_DRIVER_VERSION, strlen(TW_DRIVER_VERSION));
>> +       strlcpy(tw_dev->tw_compat_info.driver_version, TW_DRIVER_VERSION,
>> +               sizeof(tw_dev->tw_compat_info.driver_version));
>>         tw_dev->tw_compat_info.driver_srl_high = TW_CURRENT_DRIVER_SRL;
>>         tw_dev->tw_compat_info.driver_branch_high = TW_CURRENT_DRIVER_BRANCH;
>>         tw_dev->tw_compat_info.driver_build_high = TW_CURRENT_DRIVER_BUILD;
>> --
>> 1.7.10.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/
>
> Rickard,
>
> This patch looks fine.
>
> Acked-by: Adam Radford <aradford@gmail.com>
>
> -Adam


Hi Adam!

What happened to this patch?


Kind regards
Rickard Strandqvist

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: 3w-9xxx.c: Cleaning up missing null-terminate in conjunction with strncpy
  2014-12-22 22:52   ` Rickard Strandqvist
@ 2014-12-22 23:08     ` adam radford
  0 siblings, 0 replies; 5+ messages in thread
From: adam radford @ 2014-12-22 23:08 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Adam Radford, James E.J. Bottomley, linux-scsi, linux-kernel

On Mon, Dec 22, 2014 at 2:52 PM, Rickard Strandqvist
<rickard_strandqvist@spectrumdigital.se> wrote:
> 2014-08-01 0:19 GMT+02:00 adam radford <aradford@gmail.com>:
>> On Sun, Jul 27, 2014 at 8:11 AM, Rickard Strandqvist
>> <rickard_strandqvist@spectrumdigital.se> wrote:
>>> Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
>>> And use the sizeof on the to string rather than strlen on the from string.
>>>
>>> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
>>> ---
>>>  drivers/scsi/3w-9xxx.c |    3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
>>> index 0a73253..f4d2331 100644
>>> --- a/drivers/scsi/3w-9xxx.c
>>> +++ b/drivers/scsi/3w-9xxx.c
>>> @@ -621,7 +621,8 @@ static int twa_check_srl(TW_Device_Extension *tw_dev, int *flashed)
>>>         }
>>>
>>>         /* Load rest of compatibility struct */
>>> -       strncpy(tw_dev->tw_compat_info.driver_version, TW_DRIVER_VERSION, strlen(TW_DRIVER_VERSION));
>>> +       strlcpy(tw_dev->tw_compat_info.driver_version, TW_DRIVER_VERSION,
>>> +               sizeof(tw_dev->tw_compat_info.driver_version));
>>>         tw_dev->tw_compat_info.driver_srl_high = TW_CURRENT_DRIVER_SRL;
>>>         tw_dev->tw_compat_info.driver_branch_high = TW_CURRENT_DRIVER_BRANCH;
>>>         tw_dev->tw_compat_info.driver_build_high = TW_CURRENT_DRIVER_BUILD;
>>> --
>>> 1.7.10.4
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>> Please read the FAQ at  http://www.tux.org/lkml/
>>
>> Rickard,
>>
>> This patch looks fine.
>>
>> Acked-by: Adam Radford <aradford@gmail.com>
>>
>> -Adam
>
>
> Hi Adam!
>
> What happened to this patch?

It just didn't get picked up into scsi.git/for-next for some reason.

All I can do is Ack it, which I already did :)

-Adam

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: 3w-9xxx.c:  Cleaning up missing null-terminate in conjunction with strncpy
  2014-07-27 15:11 [PATCH] scsi: 3w-9xxx.c: Cleaning up missing null-terminate in conjunction with strncpy Rickard Strandqvist
  2014-07-31 22:19 ` adam radford
@ 2014-12-30 12:52 ` Christoph Hellwig
  1 sibling, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2014-12-30 12:52 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Adam Radford, James E.J. Bottomley, linux-scsi, linux-kernel

Thanks, applied to scsi-for-3.20.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-12-30 12:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-27 15:11 [PATCH] scsi: 3w-9xxx.c: Cleaning up missing null-terminate in conjunction with strncpy Rickard Strandqvist
2014-07-31 22:19 ` adam radford
2014-12-22 22:52   ` Rickard Strandqvist
2014-12-22 23:08     ` adam radford
2014-12-30 12:52 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®