From 9c0907d9ff58f0b6d1e7cddff77cb2d7cf17bd2e Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Wed, 5 Jun 2013 14:20:47 +1000 Subject: Avoid crash when byte value does not represent a character in current encoding. --- cocoa/ScintillaCocoa.mm | 2 ++ 1 file changed, 2 insertions(+) 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(sCharacter), 1, encoding, false); + if (!cfsVal) + continue; NSString *sMapped = [(NSString *)cfsVal stringByFoldingWithOptions:NSCaseInsensitiveSearch locale:[NSLocale currentLocale]]; -- cgit v1.2.3