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 | fb2c65fb27d115e562a23aa8fd6fa4fe5b256800 (patch) | |
| tree | 5064dad8e9a4040fbe8c150723776284be2d3bb7 | |
| parent | e2517c182a4f5c3ddc6d1398903df0049265b388 (diff) | |
| download | scintilla-mirror-fb2c65fb27d115e562a23aa8fd6fa4fe5b256800.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]]; |
