From: "Torsten Bögershausen" <tboegi@web.de>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH v2 1/2] commit: reject invalid UTF-8 codepoints
Date: Thu, 04 Jul 2013 21:58:08 +0200 [thread overview]
Message-ID: <51D5D3D0.3030102@web.de> (raw)
In-Reply-To: <20130704171943.GA267700@vauxhall.crustytoothpaste.net>
On 2013-07-04 19.19, brian m. carlson wrote:
> 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
s/guaranteed non-characters/code points out of range/
> this by explicitly checking for and rejecting such characters.
Do we really reject them, or do we (only) warn about them ?
Other question:
Now that we have a check for codepoints out of range, beyond U+10FFFF,
do we want to have an additional testcase ?
> +test_expect_success 'UTF-8 invalid characters refused' '
May be:
test_expect_success 'UTF-8 invalid surrogate' '
> + test_when_finished "rm -f $HOME/stderr $HOME/invalid" &&
> + rm -f "$HOME/stderr" &&
> + echo "UTF-8 characters" >F &&
> + printf "Commit message\n\nInvalid surrogate:\355\240\200\n" \
> + >"$HOME/invalid" &&
good
> + git commit -a -F "$HOME/invalid" \
> + 2>"$HOME"/stderr &&
> + grep "did not conform" "$HOME"/stderr
> +'
> +
> +rm -f "$HOME/stderr"
Does it make sense to "grep on the fly", like this:
git commit -a -F "$HOME/invalid" 2>&1 | grep "did not conform"
next prev parent reply other threads:[~2013-07-04 19:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-04 17:17 [PATCH v2 0/2] commit: improve UTF-8 validation brian m. carlson
2013-07-04 17:19 ` [PATCH v2 1/2] commit: reject invalid UTF-8 codepoints brian m. carlson
2013-07-04 19:58 ` Torsten Bögershausen [this message]
2013-07-04 20:39 ` brian m. carlson
2013-07-05 12:51 ` Peter Krefting
2013-07-08 19:36 ` Junio C Hamano
2013-07-09 11:16 ` [PATCH] commit: reject non-characters Peter Krefting
2013-08-05 12:48 ` Peter Krefting
2013-08-05 16:54 ` Junio C Hamano
2013-08-06 7:03 ` Peter Krefting
2013-07-04 17:20 ` [PATCH v2 2/2] commit: reject overlong UTF-8 sequences brian m. carlson
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51D5D3D0.3030102@web.de \
--to=tboegi@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=sandals@crustytoothpaste.net \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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).