mirror of
https://github.com/debauchee/barrier.git
synced 2026-07-07 12:27:59 +08:00
Applied patch from tailblues. It checks for a NULL result from
CFStringCreate...() to avoid a crash in a subsequent use of that NULL pointer.
This commit is contained in:
@@ -793,6 +793,13 @@ COSXKeyState::CKeyResource::getKeyID(UInt8 c)
|
||||
str, GetScriptManagerVariable(smKeyScript),
|
||||
kCFAllocatorNull);
|
||||
|
||||
// sometimes CFStringCreate...() returns NULL (e.g. Apple Korean
|
||||
// encoding with char value 214). if it did then make no key,
|
||||
// otherwise CFStringCreateMutableCopy() will crash.
|
||||
if (cfString == NULL) {
|
||||
return kKeyNone;
|
||||
}
|
||||
|
||||
// convert to precomposed
|
||||
CFMutableStringRef mcfString =
|
||||
CFStringCreateMutableCopy(kCFAllocatorDefault, 0, cfString);
|
||||
|
||||
Reference in New Issue
Block a user