ObjFW  Check-in [1acf3d2817]

Overview
Comment:Fix too big buffer in -[OFMutableString _applyTable:withSize:].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | 0.5
Files: files | file ages | folders
SHA3-256: 1acf3d2817960babb19c4b6aa8967c286483049d1fc6002c8648e9e57374b10c
User & Date: js on 2011-04-23 01:32:01
Other Links: branch diff | manifest | tags
Context
2011-04-23
02:15
OFMutableString: Call madvise() on the correct length. check-in: 6649214059 user: js tags: 0.5
01:32
Fix too big buffer in -[OFMutableString _applyTable:withSize:]. check-in: 1acf3d2817 user: js tags: 0.5
2011-04-22
21:59
OFURL: Do -[copy] in a try block to prevent leaks. check-in: 43f9221508 user: js tags: 0.5
Changes

Modified src/OFMutableString.m from [fe52a06baf] to [af20c160ff].

61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
			if ((t = table[0][*p]) != 0)
				*p = t;

		return;
	}

	ulen = [self length];
	ustr = [self allocMemoryForNItems: [self length]
				 withSize: ulen];

	i = 0;
	j = 0;
	nlen = 0;

	while (i < length) {
		clen = of_string_utf8_to_unicode(string + i, length - i, &c);

		if (clen == 0 || c > 0x10FFFF) {
			[self freeMemory: ustr];







|
|

<
|







61
62
63
64
65
66
67
68
69
70

71
72
73
74
75
76
77
78
			if ((t = table[0][*p]) != 0)
				*p = t;

		return;
	}

	ulen = [self length];
	ustr = [self allocMemoryForNItems: ulen
				 withSize: sizeof(of_unichar_t)];


	i = j = 0;
	nlen = 0;

	while (i < length) {
		clen = of_string_utf8_to_unicode(string + i, length - i, &c);

		if (clen == 0 || c > 0x10FFFF) {
			[self freeMemory: ustr];