ObjFW  Check-in [9d25dacab1]

Overview
Comment:Fix a possible out-of-bounds read in -[OFString unicodeString].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9d25dacab1edb2556e56e446aa66cc0ca1868d9b8825608cccbe41132c7f6536
User & Date: js on 2011-05-01 23:42:24
Other Links: manifest | tags
Context
2011-05-01
23:58
Autorelease the return value of -[unicodeString] and include a BOM. check-in: 7b7250a0ba user: js tags: trunk
23:42
Fix a possible out-of-bounds read in -[OFString unicodeString]. check-in: 9d25dacab1 user: js tags: trunk
14:24
Move structs and enums only needed internally to .m files. check-in: 69ebd2ccbf user: js tags: trunk
Changes

Modified src/OFString.m from [04afab8da6] to [f44982b7c8].

1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602

	i = j = 0;

	while (i < length) {
		of_unichar_t c;
		size_t cLen;

		cLen = of_string_utf8_to_unicode(string + i, length - 1, &c);

		if (cLen == 0 || c > 0x10FFFF) {
			free(ret);
			@throw [OFInvalidEncodingException newWithClass: isa];
		}

		ret[j++] = c;







|







1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602

	i = j = 0;

	while (i < length) {
		of_unichar_t c;
		size_t cLen;

		cLen = of_string_utf8_to_unicode(string + i, length - i, &c);

		if (cLen == 0 || c > 0x10FFFF) {
			free(ret);
			@throw [OFInvalidEncodingException newWithClass: isa];
		}

		ret[j++] = c;