Differences From Artifact [bb152a87a3]:
- File
src/OFMutableString.m
— part of check-in
[e6c5c90751]
at
2010-11-17 16:06:19
on branch trunk
— Remove strlen in -[appendCStringWithoutUTF8Checking:length:].
When passing a string without \0-termination, strlen would access the
passed string out of bounds. (user: js, size: 12194) [annotate] [blame] [check-ins using]
To Artifact [617a9d8416]:
- File
src/OFMutableString.m
— part of check-in
[05207af0f6]
at
2010-12-26 00:01:45
on branch trunk
— Don't use strlen in -[appendCString:withLength:].
This might cause trouble if the string is not terminated. (user: js, size: 12117) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
168 169 170 171 172 173 174 | memcpy(string + length, str, strlength + 1); length += strlength; } - (void)appendCString: (const char*)str withLength: (size_t)len { | < < < | 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | memcpy(string + length, str, strlength + 1); length += strlength; } - (void)appendCString: (const char*)str withLength: (size_t)len { switch (of_string_check_utf8(str, len)) { case 1: isUTF8 = YES; break; case -1: @throw [OFInvalidEncodingException newWithClass: isa]; } |
︙ | ︙ |