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 sand...@crustytoothpaste.net 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

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

2013-07-03 Thread Junio C Hamano
brian m. carlson sand...@crustytoothpaste.net 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

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

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

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

[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 sand...@crustytoothpaste.net --- commit.c

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

2013-06-29 Thread Junio C Hamano
brian m. carlson sand...@crustytoothpaste.net 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:

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 sand...@crustytoothpaste.net 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