ObjFW  Check-in [13fe99629c]

Overview
Comment:Check the item size of the passed data array in of_base64_decode().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | 0.5
Files: files | file ages | folders
SHA3-256: 13fe99629cdef51a9b58232173dc7f9fc8e9aaa0bd5f1d21c7bb9bcd20668a02
User & Date: js on 2011-06-26 23:40:06
Other Links: branch diff | manifest | tags
Context
2011-06-26
23:40
Check the item size of the passed data array in of_base64_decode(). check-in: 13fe99629c user: js tags: 0.5
00:59
Check for buggy -Wcast-align. check-in: 9653fe1e73 user: js tags: 0.5
2011-04-28
18:03
Don't allow nil in -[initWithObjectForKey:] and optimize -[description]. check-in: 362d3ed5e8 user: js tags: 0.5
Changes

Modified src/base64.m from [769602ecfc] to [795ed0f2f5].

100
101
102
103
104
105
106



107
108
109
110
111
112
113
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116







+
+
+







of_base64_decode(OFDataArray *data, const char *str, size_t len)
{
	const uint8_t *buf = (const uint8_t*)str;
	size_t i;

	if ((len & 3) != 0)
		return NO;

	if ([data itemSize] != 1)
		return NO;

	for (i = 0; i < len; i += 4) {
		uint32_t sb = 0;
		uint8_t cnt = 3;
		char db[3];
		char tmp;