git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Turner <dturner@twopensource.com>
To: Ramsay Jones <ramsay@ramsayjones.plus.com>,
	Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Cc: Jeff King <peff@peff.net>, Junio C Hamano <gitster@pobox.com>,
	GIT Mailing-list <git@vger.kernel.org>
Subject: Re: [PATCH 2/3] index-helper: convert strncpy to memcpy
Date: Mon, 11 Apr 2016 18:30:54 -0400	[thread overview]
Message-ID: <1460413854.5540.24.camel@twopensource.com> (raw)
In-Reply-To: <570ADB68.8000705@ramsayjones.plus.com>

On Mon, 2016-04-11 at 00:02 +0100, Ramsay Jones wrote:
> see commit eddda371 ("convert strncpy to memcpy", 24-09-2015).
> 
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
> ---
>  index-helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/index-helper.c b/index-helper.c
> index 4a8e2ae..00f286a 100644
> --- a/index-helper.c
> +++ b/index-helper.c
> @@ -317,7 +317,7 @@ static int setup_socket(const char *socket_path)
>  		return -1;
>  
>  	address.sun_family = AF_UNIX;
> -	strncpy(address.sun_path, socket_path,
> sizeof(address.sun_path));
> +	memcpy(address.sun_path, socket_path, len+1); /* include
> '\0' */
>  
>  	if (bind(fd, (struct sockaddr *) &address, sizeof(address)))
>  		die_errno(_("failed to bind to socket %s"),
> socket_path);

Thanks. 

I'm actually going to drop this patch because I'm switching to the unix
-socket.c helpers, so the affected code no longer exists.  But I
appreciate the thought anyway.

      reply	other threads:[~2016-04-11 22:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-10 23:02 [PATCH 2/3] index-helper: convert strncpy to memcpy Ramsay Jones
2016-04-11 22:30 ` David Turner [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=1460413854.5540.24.camel@twopensource.com \
    --to=dturner@twopensource.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    --cc=ramsay@ramsayjones.plus.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 NNTP newsgroup(s).