pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/inputmethod/fcitx



Module Name:    pkgsrc
Committed By:   maya
Date:           Sun Dec  7 03:00:56 UTC 2025

Modified Files:
        pkgsrc/inputmethod/fcitx: distinfo
        pkgsrc/inputmethod/fcitx/patches: patch-src_lib_fcitx-utils_utils.c
            patch-src_module_unicode_charselectdata.c
Added Files:
        pkgsrc/inputmethod/fcitx/patches: patch-src_lib_fcitx-config_hotkey.c
            patch-src_module_quickphrase_quickphrase.c patch-src_module_vk_vk.c
            patch-src_ui_classic_skin.c patch-src_ui_kimpanel_kimpanel.c
            patch-tools_cli_mb2txt.c

Log Message:
fcitx: Fix build-time segmentation fault on NetBSD 11 by fixing ctype abuse

While here review the rest of the code for ctype abuse which might cause
run-time crashes in the same platform.

reviewed by riastradh.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 pkgsrc/inputmethod/fcitx/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/inputmethod/fcitx/patches/patch-src_lib_fcitx-config_hotkey.c \
    pkgsrc/inputmethod/fcitx/patches/patch-src_module_quickphrase_quickphrase.c \
    pkgsrc/inputmethod/fcitx/patches/patch-src_module_vk_vk.c \
    pkgsrc/inputmethod/fcitx/patches/patch-src_ui_classic_skin.c \
    pkgsrc/inputmethod/fcitx/patches/patch-src_ui_kimpanel_kimpanel.c \
    pkgsrc/inputmethod/fcitx/patches/patch-tools_cli_mb2txt.c
cvs rdiff -u -r1.2 -r1.3 \
    pkgsrc/inputmethod/fcitx/patches/patch-src_lib_fcitx-utils_utils.c
cvs rdiff -u -r1.1 -r1.2 \
    pkgsrc/inputmethod/fcitx/patches/patch-src_module_unicode_charselectdata.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/inputmethod/fcitx/distinfo
diff -u pkgsrc/inputmethod/fcitx/distinfo:1.7 pkgsrc/inputmethod/fcitx/distinfo:1.8
--- pkgsrc/inputmethod/fcitx/distinfo:1.7       Wed Dec 20 12:03:24 2023
+++ pkgsrc/inputmethod/fcitx/distinfo   Sun Dec  7 03:00:55 2025
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.7 2023/12/20 12:03:24 nros Exp $
+$NetBSD: distinfo,v 1.8 2025/12/07 03:00:55 maya Exp $
 
 BLAKE2s (en_dict-20121020.tar.gz) = 9945545f2402d0eb35bd46701e51f191da0b740854d0c8da11d7670aa1ad014f
 SHA512 (en_dict-20121020.tar.gz) = 8418bd02492bfd786c0fab93be4400ef027ec8e9fac02220cc1f653f5eb67f54573a6a84a15baba19bb34ab892745c87df16499d6304ea75009131e2ab3b97f2
@@ -21,10 +21,18 @@ Size (table.tar.gz) = 4144686 bytes
 SHA1 (patch-cmake_FcitxMacro.cmake) = e3dcba315711fc6b96f5620de1e03e096635bab2
 SHA1 (patch-cmake_FindEnchant.cmake) = e2a2572d60515c80ec736dd1d8d07779aa324da0
 SHA1 (patch-src_im_pinyin_data_CMakeLists.txt) = dd17df37a5b6781a645a4190cb8111811f804189
+SHA1 (patch-src_im_pinyin_sp.c) = 94b4d89ebd635726161b7743b3931d6003731c80
 SHA1 (patch-src_im_table_data_CMakeLists.txt) = 3ef3d05ee036f9bb845b69c97c50ac76cc11478e
-SHA1 (patch-src_lib_fcitx-utils_utils.c) = 6b555f159986a08645e36e27814111d59d71b0a8
+SHA1 (patch-src_lib_fcitx-config_hotkey.c) = bacd46f4d716c8175e5ab86cb08b95212e1e6df3
+SHA1 (patch-src_lib_fcitx-utils_utils.c) = 15c0f9d9123edd44b95aaf0b2f7b636779f98df6
+SHA1 (patch-src_module_quickphrase_quickphrase.c) = ad1284777bdcc2ed017cf1b1160e8e4de6e52d4e
 SHA1 (patch-src_module_spell_dict_CMakeLists.txt) = 98372bb2c160e9bb8917ea523465924edab2c1e3
 SHA1 (patch-src_module_spell_dict_comp__spell__dict.c) = 5f67983a9a96f6b6f61874a32ed3e70a9c66f083
 SHA1 (patch-src_module_spell_spell-custom-dict.c) = 374e5a7498c6a620f95199cdda40be615409a4ae
 SHA1 (patch-src_module_spell_spell-custom.c) = 6b677936dfdbe687a06e30703b309faa1bf6372f
-SHA1 (patch-src_module_unicode_charselectdata.c) = 8d771bdd934e5038f080f9cb87ae1e6a9be54e3e
+SHA1 (patch-src_module_unicode_charselectdata.c) = 548f2f73f790c438ba0df234ca3990d44c01ea56
+SHA1 (patch-src_module_vk_vk.c) = cc3f2170fa3b930baea59b806b7c2c1f3319d079
+SHA1 (patch-src_ui_classic_skin.c) = 7d14955a3503a6d866b0a6495722c78be0029e0d
+SHA1 (patch-src_ui_kimpanel_kimpanel.c) = a0325039b35271d297a1b2ec1eeaa10899072f48
+SHA1 (patch-tools_cli_mb2txt.c) = 3eb771cb13ed9b6f0dc28ec301460314a4966639
+SHA1 (patch-tools_cli_txt2mb.c) = ed63d58e88b4222927c05e280c21e9c9be24d1f7

Index: pkgsrc/inputmethod/fcitx/patches/patch-src_lib_fcitx-utils_utils.c
diff -u pkgsrc/inputmethod/fcitx/patches/patch-src_lib_fcitx-utils_utils.c:1.2 pkgsrc/inputmethod/fcitx/patches/patch-src_lib_fcitx-utils_utils.c:1.3
--- pkgsrc/inputmethod/fcitx/patches/patch-src_lib_fcitx-utils_utils.c:1.2      Wed Dec 20 12:03:25 2023
+++ pkgsrc/inputmethod/fcitx/patches/patch-src_lib_fcitx-utils_utils.c  Sun Dec  7 03:00:55 2025
@@ -1,6 +1,7 @@
-$NetBSD: patch-src_lib_fcitx-utils_utils.c,v 1.2 2023/12/20 12:03:25 nros Exp $
+$NetBSD: patch-src_lib_fcitx-utils_utils.c,v 1.3 2025/12/07 03:00:55 maya Exp $
 
 Illumos has endian.h just like Linux
+Fix ctype abuse by casting to unsigned char
 
 --- src/lib/fcitx-utils/utils.c.orig   2017-12-22 18:02:24.000000000 +0000
 +++ src/lib/fcitx-utils/utils.c
@@ -22,3 +23,12 @@ Illumos has endian.h just like Linux
  #include <endian.h>
  #else
  #include <sys/endian.h>
+@@ -400,7 +402,7 @@ char* fcitx_utils_trim(const char* s)
+ 
+     s += strspn(s, "\f\n\r\t\v ");
+     end = s + (strlen(s) - 1);
+-    while (end >= s && isspace(*end))               /* skip trailing space */
++    while (end >= s && isspace((unsigned char)*end))               /* skip trailing space */
+         --end;
+ 
+     end++;

Index: pkgsrc/inputmethod/fcitx/patches/patch-src_module_unicode_charselectdata.c
diff -u pkgsrc/inputmethod/fcitx/patches/patch-src_module_unicode_charselectdata.c:1.1 pkgsrc/inputmethod/fcitx/patches/patch-src_module_unicode_charselectdata.c:1.2
--- pkgsrc/inputmethod/fcitx/patches/patch-src_module_unicode_charselectdata.c:1.1      Wed Dec 20 12:03:25 2023
+++ pkgsrc/inputmethod/fcitx/patches/patch-src_module_unicode_charselectdata.c  Sun Dec  7 03:00:56 2025
@@ -1,8 +1,9 @@
-$NetBSD: patch-src_module_unicode_charselectdata.c,v 1.1 2023/12/20 12:03:25 nros Exp $
+$NetBSD: patch-src_module_unicode_charselectdata.c,v 1.2 2025/12/07 03:00:56 maya Exp $
 
 Illumos has endian.h just like Linux
+Fix ctype abuse by casting to unsigned char
 
---- src/module/unicode/charselectdata.c.orig   2023-12-20 12:50:04.703947794 +0000
+--- src/module/unicode/charselectdata.c.orig   2017-12-22 18:02:24.000000000 +0000
 +++ src/module/unicode/charselectdata.c
 @@ -11,7 +11,7 @@
  #include <fcitx-utils/utils.h>
@@ -13,3 +14,39 @@ Illumos has endian.h just like Linux
  #include <endian.h>
  #else
  #include <sys/endian.h>
+@@ -290,7 +290,7 @@ char* Simplified(const char* src)
+     while(*s) {
+         char c = *s;
+ 
+-        if (isspace(c)) {
++        if (isspace((unsigned char) c)) {
+             if (!lastIsSpace) {
+                 *p = ' ';
+                 p ++;
+@@ -321,7 +321,7 @@ int IsHexString(const char* s)
+ 
+     s += 2;
+     while (*s) {
+-        if (!isxdigit(*s))
++        if (!isxdigit((unsigned char) *s))
+             return 0;
+         s++;
+     }
+@@ -622,7 +622,7 @@ UT_array* SplitString(const char* s)
+     int end = 0;
+     int length = strlen(s);
+     while (end < length) {
+-        while (end < length && (isdigit(s[end]) || isalpha(s[end]) || s[end] == '+')) {
++        while (end < length && (isdigit((unsigned char) s[end]) || isalpha((unsigned char) s[end]) || s[end] == '+')) {
+             end++;
+         }
+         if (start != end) {
+@@ -631,7 +631,7 @@ UT_array* SplitString(const char* s)
+             free(p);
+         }
+         start = end;
+-        while (end < length && !(isdigit(s[end]) || isalpha(s[end]) || s[end] == '+')) {
++        while (end < length && !(isdigit((unsigned char) s[end]) || isalpha((unsigned char) s[end]) || s[end] == '+')) {
+             end++;
+             start++;
+         }

Added files:

Index: pkgsrc/inputmethod/fcitx/patches/patch-src_lib_fcitx-config_hotkey.c
diff -u /dev/null pkgsrc/inputmethod/fcitx/patches/patch-src_lib_fcitx-config_hotkey.c:1.1
--- /dev/null   Sun Dec  7 03:00:56 2025
+++ pkgsrc/inputmethod/fcitx/patches/patch-src_lib_fcitx-config_hotkey.c        Sun Dec  7 03:00:55 2025
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_lib_fcitx-config_hotkey.c,v 1.1 2025/12/07 03:00:55 maya Exp $
+
+Fix ctype abuse by casting to unsigned char
+
+--- src/lib/fcitx-config/hotkey.c.orig 2025-12-06 22:31:02.707466261 +0000
++++ src/lib/fcitx-config/hotkey.c
+@@ -675,7 +675,7 @@ char* FcitxHotkeyGetReadableKeyString(Fc
+         if (i == 0) {
+             continue;
+         }
+-        key[i] = tolower(key[i]);
++        key[i] = tolower((unsigned char) key[i]);
+     }
+     strcpy(str + len, key);
+ 
Index: pkgsrc/inputmethod/fcitx/patches/patch-src_module_quickphrase_quickphrase.c
diff -u /dev/null pkgsrc/inputmethod/fcitx/patches/patch-src_module_quickphrase_quickphrase.c:1.1
--- /dev/null   Sun Dec  7 03:00:56 2025
+++ pkgsrc/inputmethod/fcitx/patches/patch-src_module_quickphrase_quickphrase.c Sun Dec  7 03:00:55 2025
@@ -0,0 +1,22 @@
+$NetBSD: patch-src_module_quickphrase_quickphrase.c,v 1.1 2025/12/07 03:00:55 maya Exp $
+
+Fix ctype abuse by casting to unsigned char
+
+--- src/module/quickphrase/quickphrase.c.orig  2025-12-06 22:31:33.481721537 +0000
++++ src/module/quickphrase/quickphrase.c
+@@ -263,13 +263,13 @@ void LoadQuickPhraseFromFile(QuickPhrase
+         buf1 = fcitx_utils_trim(buf);
+         char *p = buf1;
+ 
+-        while (*p && !isspace(*p))
++        while (*p && !isspace((unsigned char) *p))
+             p ++;
+ 
+         if (*p == '\0')
+             continue;
+ 
+-        while (isspace(*p)) {
++        while (isspace((unsigned char) *p)) {
+             *p = '\0';
+             p ++;
+         }
Index: pkgsrc/inputmethod/fcitx/patches/patch-src_module_vk_vk.c
diff -u /dev/null pkgsrc/inputmethod/fcitx/patches/patch-src_module_vk_vk.c:1.1
--- /dev/null   Sun Dec  7 03:00:56 2025
+++ pkgsrc/inputmethod/fcitx/patches/patch-src_module_vk_vk.c   Sun Dec  7 03:00:56 2025
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_module_vk_vk.c,v 1.1 2025/12/07 03:00:56 maya Exp $
+
+Fix ctype abuse by casting to unsigned char
+
+--- src/module/vk/vk.c.orig    2025-12-06 22:33:28.222526551 +0000
++++ src/module/vk/vk.c
+@@ -600,7 +600,7 @@ void LoadVKMapFile(FcitxVKState *vkstate
+                 continue;
+ 
+             for (i = 0; i < VK_NUMBERS; i++) {
+-                if (vkTable[i] == tolower(pstr[0])) {
++                if (vkTable[i] == tolower((unsigned char) pstr[0])) {
+                     pstr += 2;
+                     while (*pstr == ' ' || *pstr == '\t')
+                         pstr++;
Index: pkgsrc/inputmethod/fcitx/patches/patch-src_ui_classic_skin.c
diff -u /dev/null pkgsrc/inputmethod/fcitx/patches/patch-src_ui_classic_skin.c:1.1
--- /dev/null   Sun Dec  7 03:00:56 2025
+++ pkgsrc/inputmethod/fcitx/patches/patch-src_ui_classic_skin.c        Sun Dec  7 03:00:56 2025
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_ui_classic_skin.c,v 1.1 2025/12/07 03:00:56 maya Exp $
+
+Fix ctype abuse by casting to unsigned char
+
+--- src/ui/classic/skin.c.orig 2025-12-06 22:35:36.759885141 +0000
++++ src/ui/classic/skin.c
+@@ -768,7 +768,7 @@ SkinImage* GetIMIcon(FcitxClassicUI* cla
+         if (*im->langCode) {
+             strncpy(temp, im->langCode, LANGCODE_LENGTH);
+             iconText = temp;
+-            iconText[0] = toupper(iconText[0]);
++            iconText[0] = toupper((unsigned char) iconText[0]);
+         } else {
+             iconText = im->uniqueName + strlen("fcitx-keyboard-");
+         }
Index: pkgsrc/inputmethod/fcitx/patches/patch-src_ui_kimpanel_kimpanel.c
diff -u /dev/null pkgsrc/inputmethod/fcitx/patches/patch-src_ui_kimpanel_kimpanel.c:1.1
--- /dev/null   Sun Dec  7 03:00:56 2025
+++ pkgsrc/inputmethod/fcitx/patches/patch-src_ui_kimpanel_kimpanel.c   Sun Dec  7 03:00:56 2025
@@ -0,0 +1,29 @@
+$NetBSD: patch-src_ui_kimpanel_kimpanel.c,v 1.1 2025/12/07 03:00:56 maya Exp $
+
+Fix ctype abuse by casting to unsigned char
+
+--- src/ui/kimpanel/kimpanel.c.orig    2025-12-06 22:36:52.753698558 +0000
++++ src/ui/kimpanel/kimpanel.c
+@@ -232,8 +232,8 @@ static void SetIMMenu(FcitxIM *pim, char
+                 strlen("fcitx-keyboard-")) != 0) {
+         icon = pim->strIconName;
+     } else if (isUnity()) {
+-        layout[INDICATOR_KEYBOARD_LENGTH] = toupper(pim->langCode[0]);
+-        layout[INDICATOR_KEYBOARD_LENGTH + 1] = tolower(pim->langCode[1]);
++        layout[INDICATOR_KEYBOARD_LENGTH] = toupper((unsigned char) pim->langCode[0]);
++        layout[INDICATOR_KEYBOARD_LENGTH + 1] = tolower((unsigned char) pim->langCode[1]);
+         icon = layout;
+     }
+     boolean result = CheckAddPrefix(&icon);
+@@ -262,9 +262,9 @@ static void SetIMIcon(FcitxInstance* ins
+                         strlen("fcitx-keyboard-")) == 0) {
+                 if (isUnity()) {
+                     layout[INDICATOR_KEYBOARD_LENGTH] =
+-                        toupper(im->langCode[0]);
++                        toupper((unsigned char) im->langCode[0]);
+                     layout[INDICATOR_KEYBOARD_LENGTH + 1] =
+-                        tolower(im->langCode[1]);
++                        tolower((unsigned char) im->langCode[1]);
+                     icon = layout;
+                 } else {
+                     icon = "";
Index: pkgsrc/inputmethod/fcitx/patches/patch-tools_cli_mb2txt.c
diff -u /dev/null pkgsrc/inputmethod/fcitx/patches/patch-tools_cli_mb2txt.c:1.1
--- /dev/null   Sun Dec  7 03:00:56 2025
+++ pkgsrc/inputmethod/fcitx/patches/patch-tools_cli_mb2txt.c   Sun Dec  7 03:00:56 2025
@@ -0,0 +1,15 @@
+$NetBSD: patch-tools_cli_mb2txt.c,v 1.1 2025/12/07 03:00:56 maya Exp $
+
+Fix ctype abuse by casting to unsigned char
+
+--- tools/cli/mb2txt.c.orig    2025-12-06 22:37:28.453047847 +0000
++++ tools/cli/mb2txt.c
+@@ -85,7 +85,7 @@ char guessValidChar(char prefer, const c
+         return prefer;
+     unsigned char c = 0;
+     for (c = 0; c <= 127; c ++) {
+-        if (ispunct(c) || isalnum(c)) {
++        if (ispunct((unsigned char) c) || isalnum((unsigned char) c)) {
+             if (!strchr(invalid, c))
+                 break;
+         }



Home | Main Index | Thread Index | Old Index