From af2661e317f7b09f819233173ed9eedbc0cc19f9 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 22 Oct 2013 14:11:52 +0900 Subject: [PATCH] add NULL check of p->name in scim_string_to_key () Change-Id: I11c8c1abbd1d68f59ab174570d3d766443d8a023 --- ism/src/scim_event.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ism/src/scim_event.cpp b/ism/src/scim_event.cpp index 762ffb9..20ff5a7 100644 --- a/ism/src/scim_event.cpp +++ b/ism/src/scim_event.cpp @@ -296,11 +296,11 @@ scim_string_to_key (KeyEvent &key, const String & str) it->c_str (), __KeyNameLessByName ()); - if (p != __scim_keys_by_name + SCIM_NUM_KEY_NAMES && strcmp (p->name, it->c_str ()) == 0) { + if (p != __scim_keys_by_name + SCIM_NUM_KEY_NAMES && p && p->name && strcmp (p->name, it->c_str ()) == 0) { key.code = p->value; } else if (it->length () >= 6 && (*it)[0] == '0' && ((*it)[1] == 'x' || (*it)[1] == 'X')){ key.code = strtol (it->c_str () + 2, NULL, 16); - } else if (strcmp (p->name, "VoidSymbol") == 0) { + } else if (p && p->name && strcmp (p->name, "VoidSymbol") == 0) { key.code = SCIM_KEY_VoidSymbol; } } -- 2.7.4