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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]