한자 검색 루틴에서 null 포인터 확인:
authorChoe Hwanjin <choe.hwanjin@gmail.com>
Sat, 23 Feb 2008 17:45:13 +0000 (02:45 +0900)
committerChoe Hwanjin <choe.hwanjin@gmail.com>
Sat, 23 Feb 2008 17:45:13 +0000 (02:45 +0900)
 * hanja_table_match_prefix(), hanja_table_match_suffix()에서 table이
   null이면 검색하지 않음

git-svn-id: http://kldp.net/svn/hangul/libhangul/trunk@160 8f00fcd2-89fc-0310-932e-b01be5b65e01

hangul/hanja.c

index 8b1e85f..2659a4d 100644 (file)
@@ -970,6 +970,9 @@ hanja_table_match_prefix(const HanjaTable* table, const char *key)
     if (key == NULL || key[0] == '\0')
        return NULL;
 
+    if (table == NULL)
+       return NULL;
+
     newkey = strdup(key);
     p = strchr(newkey, '\0');
     while (newkey[0] != '\0') {
@@ -992,6 +995,9 @@ hanja_table_match_suffix(const HanjaTable* table, const char *key)
     if (key == NULL || key[0] == '\0')
        return NULL;
 
+    if (table == NULL)
+       return NULL;
+
     p = key;
     while (p[0] != '\0') {
        table->match(table, p, &ret);