git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] commit: reject overlong UTF-8 sequences

From
Peter Krefting <peter@softwolves.pp.se>
Date
Jul 1, 2013, 07:14 UTC
Message-ID
<alpine.DEB.2.00.1307010812470.21709@ds9.cixit.se>
In-Reply-To
<20130629174140.GC226907@vauxhall.crustytoothpaste.net>
brian m. carlson:
> 	int offset = 0;
> +	static const unsigned int max_codepoint[] = {
> +		0x7f, 0x7ff, 0xffff, 0x1fffff
> +	};

Since Unicode is not defined beyond U+10FFFF, you can easily make the last range end at U+10FFF. Doing that, ...

> 		if (codepoint > 0x10ffff)
> 			return bad_offset;

... you can also drop this test, as it will have been tested by the max test already.

-- 
\\// Peter - http://www.softwolves.pp.se/
Previous: brian m. carlson
Message 2 of 2 in “commit: reject overlong UTF-8 sequences”
  1. 2/2 commit: reject overlong UTF-8 sequencesbrian m. carlson, Jun 29, 2013
  2. Peter KreftingJul 1, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.