linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Giel van Schijndel <me@mortis.eu>
To: linux-kernel@vger.kernel.org
Cc: Brian King <brking@us.ibm.com>,
	"James E.J. Bottomley" <JBottomley@parallels.com>,
	"open list:SCSI SUBSYSTEM" <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] Cleanup: snprintf() always NUL-terminates: depend on it
Date: Mon, 5 Jan 2015 00:05:47 +0100	[thread overview]
Message-ID: <20150104230547.GK4806@salidar.dom.custoft.eu> (raw)
In-Reply-To: <1420394759-20345-1-git-send-email-me@mortis.eu>

[-- Attachment #1: Type: text/plain, Size: 651 bytes --]

On Sun, Jan 04, 2015 at 19:05:58 +0100, Giel van Schijndel wrote:
> Especially since one very strange piece of code seems to be written in
> such a way that a NUL needs to be placed where a NUL is present already.
> The author probably meant to fill the last byte of the buffer with a NUL
> instead. But regardless of that: that isn't necessary since snprintf()
> already guarantees NUL termination for buffers sizes > 0 and <= INT_MAX.
> ---

Forgot to:
Signed-off-by: Giel van Schijndel <me@mortis.eu>

-- 
Met vriendelijke groet,
With kind regards,
Giel van Schijndel
--
Of course I talk to myself. Sometimes I need expert advice.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  parent reply	other threads:[~2015-01-04 23:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-04 18:05 [PATCH] Cleanup: snprintf() always NUL-terminates: depend on it Giel van Schijndel
2015-01-04 19:34 ` Linus Torvalds
2015-01-04 22:38   ` Giel van Schijndel
2015-01-04 23:05 ` Giel van Schijndel [this message]
2015-01-07 19:20 ` [PATCH RESEND] scsi: cleanup: " Giel van Schijndel
  -- strict thread matches above, loose matches on Subject: below --
2015-01-12  9:07 [PATCH] Cleanup: " Aleksandr P

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=20150104230547.GK4806@salidar.dom.custoft.eu \
    --to=me@mortis.eu \
    --cc=JBottomley@parallels.com \
    --cc=brking@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).