Re: [PATCH 1/2] commit: reject invalid UTF-8 codepoints

2013-07-03 Thread Junio C Hamano
"brian m. carlson" writes: > git format-patch --binary seems to produce the exact same output as > without the --binary option. Is there a different way I should be > selecting the binary option? These days --binary is a no-op option for format-patch (we used to default to showing "binary files

Re: [PATCH 1/2] commit: reject invalid UTF-8 codepoints

2013-07-03 Thread brian m. carlson
On Sat, Jun 29, 2013 at 07:13:40PM -0700, Junio C Hamano wrote: > "brian m. carlson" writes: > > diff --git a/t/t3900/UTF-8-invalid.txt b/t/t3900/UTF-8-invalid.txt > > new file mode 100644 > > index 000..343684d > > --- /dev/null > > +++ b/t/t3900/UTF-8-invalid.txt > > @@ -0,0 +1,3 @@ > > +Com

Re: [PATCH 1/2] commit: reject invalid UTF-8 codepoints

2013-07-01 Thread Peter Krefting
brian m. carlson: + /* Check the value here */ + if (codepoint >= 0xd800 && codepoint <= 0xdfff) + return bad_offset; if ((x & 0xF800) == 0xD800) is slightly shorter, albeit a bit more difficult to read. Please also consider adding some c

Re: [PATCH 1/2] commit: reject invalid UTF-8 codepoints

2013-06-30 Thread Junio C Hamano
"brian m. carlson" writes: > On Sat, Jun 29, 2013 at 07:13:40PM -0700, Junio C Hamano wrote: >> "brian m. carlson" writes: >> Does this correspond to the following comment in the same file, and >> if so, shouldn't this part of your patch? > > Yes, yes, it should. > ... >> As that comment I quote

Re: [PATCH 1/2] commit: reject invalid UTF-8 codepoints

2013-06-29 Thread brian m. carlson
On Sat, Jun 29, 2013 at 07:13:40PM -0700, Junio C Hamano wrote: > "brian m. carlson" writes: > Does this correspond to the following comment in the same file, and > if so, shouldn't this part of your patch? Yes, yes, it should. > We used to allow te original up-to-6 form and this update is about

Re: [PATCH 1/2] commit: reject invalid UTF-8 codepoints

2013-06-29 Thread Junio C Hamano
"brian m. carlson" writes: > The commit code already contains code for validating UTF-8, but it > does not check for invalid values, such as guaranteed > non-characters and surrogates. Fix this by explicitly checking > for and rejecting such characters. > > Signed-off-by: brian m. carlson > ---

[PATCH 1/2] commit: reject invalid UTF-8 codepoints

2013-06-29 Thread brian m. carlson
The commit code already contains code for validating UTF-8, but it does not check for invalid values, such as guaranteed non-characters and surrogates. Fix this by explicitly checking for and rejecting such characters. Signed-off-by: brian m. carlson --- commit.c | 18 +