From fb2c65fb27d115e562a23aa8fd6fa4fe5b256800 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(+) (limited to 'cocoa') 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