public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>,
	linux390@de.ibm.com, linux-s390@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] s390: char: sclp_async.c:  Cleaning up missing null-terminate in conjunction with strncpy
Date: Mon, 28 Jul 2014 21:00:09 +0200	[thread overview]
Message-ID: <20140728190009.GB3769@osiris> (raw)
In-Reply-To: <1406385047-2942-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

On Sat, Jul 26, 2014 at 04:30:47PM +0200, Rickard Strandqvist wrote:
> Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
> 
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  drivers/s390/char/sclp_async.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/s390/char/sclp_async.c b/drivers/s390/char/sclp_async.c
> index 5f9f929..585de0a 100644
> --- a/drivers/s390/char/sclp_async.c
> +++ b/drivers/s390/char/sclp_async.c
> @@ -132,12 +132,12 @@ static int sclp_async_send_wait(char *message)
>  	request->command = SCLP_CMDW_WRITE_EVENT_DATA;
>  	request->sccb = sccb;
>  	request->status = SCLP_REQ_FILLED;
> -	strncpy(sccb->evbuf.data, message, sizeof(sccb->evbuf.data));
> +	strlcpy(sccb->evbuf.data, message, sizeof(sccb->evbuf.data));

Do your patches actually fix any bugs? E.g. this line fills a hardware data
structure, which must not necessarily be null terminated. Actually you even
could have introduced a bug here.
So, please state which of your patches actually do fix bugs.


      reply	other threads:[~2014-07-28 19:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-26 14:30 [PATCH] s390: char: sclp_async.c: Cleaning up missing null-terminate in conjunction with strncpy Rickard Strandqvist
2014-07-28 19:00 ` Heiko Carstens [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140728190009.GB3769@osiris \
    --to=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux390@de.ibm.com \
    --cc=rickard_strandqvist@spectrumdigital.se \
    --cc=schwidefsky@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox