Re: [PATCH 52/67] use sha1_to_hex_to() instead of strcpy

2015-09-16 Thread Junio C Hamano
Jeff King writes: > I think we can save even more in ownbuf, which holds only octal > modes. That was out of scope for this patch, though. :) Sure. Also the variable is misnamed. It is modebuf[], I think. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a messag

Re: [PATCH 52/67] use sha1_to_hex_to() instead of strcpy

2015-09-16 Thread Jeff King
On Wed, Sep 16, 2015 at 02:51:13PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > diff --git a/builtin/merge-index.c b/builtin/merge-index.c > > index 1d66111..4ed0a83 100644 > > --- a/builtin/merge-index.c > > +++ b/builtin/merge-index.c > > @@ -9,7 +9,7 @@ static int merge_entry(int po

Re: [PATCH 52/67] use sha1_to_hex_to() instead of strcpy

2015-09-16 Thread Junio C Hamano
Jeff King writes: > diff --git a/builtin/merge-index.c b/builtin/merge-index.c > index 1d66111..4ed0a83 100644 > --- a/builtin/merge-index.c > +++ b/builtin/merge-index.c > @@ -9,7 +9,7 @@ static int merge_entry(int pos, const char *path) > { > int found; > const char *arguments[] =

[PATCH 52/67] use sha1_to_hex_to() instead of strcpy

2015-09-15 Thread Jeff King
Before sha1_to_hex_to() existed, a simple way to get a hex sha1 into a buffer was with: strcpy(buf, sha1_to_hex(sha1)); This isn't wrong (assuming the buf is 41 characters), but it makes auditing the code base for bad strcpy() calls harder, as these become false positives. Let's convert them t