diff options
author | nyamatongwe <nyamatongwe@gmail.com> | 2013-06-05 14:20:47 +1000 |
---|---|---|
committer | nyamatongwe <nyamatongwe@gmail.com> | 2013-06-05 14:20:47 +1000 |
commit | 9c0907d9ff58f0b6d1e7cddff77cb2d7cf17bd2e (patch) | |
tree | e35faa58d36cf71be0394350fc3e24e110ddf74f | |
parent | cbbd2a1a8dad0da8d45fc41e99d541d2a95e1736 (diff) | |
download | scintilla-mirror-9c0907d9ff58f0b6d1e7cddff77cb2d7cf17bd2e.tar.gz |
Avoid crash when byte value does not represent a character in current encoding.
-rw-r--r-- | cocoa/ScintillaCocoa.mm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index b8c948dda..910cd344a 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -606,6 +606,8 @@ CaseFolder *ScintillaCocoa::CaseFolderForEncoding() { CFStringRef cfsVal = CFStringCreateWithBytes(kCFAllocatorDefault, reinterpret_cast<const UInt8 *>(sCharacter), 1, encoding, false); + if (!cfsVal) + continue; NSString *sMapped = [(NSString *)cfsVal stringByFoldingWithOptions:NSCaseInsensitiveSearch locale:[NSLocale currentLocale]]; |