public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Chen Gang <gang.chen.5i5j@gmail.com>
Cc: dodji@redhat.com, kcc@google.com, dvyukov@google.com,
	       gcc-patches List <gcc-patches@gcc.gnu.org>,
	Jeff Law <law@redhat.com>
Subject: Re: [PATCH] libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc: Avoid writing '\0' out of string's border
Date: Mon, 01 Sep 2014 08:42:00 -0000	[thread overview]
Message-ID: <20140901084151.GH17454@tucnak.redhat.com> (raw)
In-Reply-To: <53FE5EF6.5030003@gmail.com>

On Thu, Aug 28, 2014 at 06:43:02AM +0800, Chen Gang wrote:
> 'max_len' is the maximized length of 'name', so for writing '\0' to
> "name[max_len]", it is out of string's border, need use "max_len - 1"
> instead of.

Depends on how the function's API is defined.
And, at least in GCC sources that function seems to be completely unused,
nothing calls it, so it is hard to guess what the API should be.

> 2014-08-27  Chen Gang  <gang.chen.5i5j@gmail.com>
> 
> 	* sanitizer_common/sanitizer_linux_libcdep.cc
> 	(SanitizerGetThreadName): Avoid writing '\0' out of string's
> 	border

	Jakub

  parent reply	other threads:[~2014-09-01  8:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27 22:43 Chen Gang
2014-08-27 22:51 ` Konstantin Serebryany
2014-08-27 22:58   ` Chen Gang
2014-08-30  3:53     ` Chen Gang
2014-09-01  8:42 ` Jakub Jelinek [this message]
2014-09-01  8:52   ` Chen Gang

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=20140901084151.GH17454@tucnak.redhat.com \
    --to=jakub@redhat.com \
    --cc=dodji@redhat.com \
    --cc=dvyukov@google.com \
    --cc=gang.chen.5i5j@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kcc@google.com \
    --cc=law@redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).