Piotr Caban : msvcrt: Validate character in _ismbcl0.

Alexandre Julliard julliard at winehq.org
Thu Feb 14 16:19:11 CST 2019


Module: wine
Branch: master
Commit: 622c218cb2802278045a0f864952eb0075318a2b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=622c218cb2802278045a0f864952eb0075318a2b

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu Feb 14 14:35:19 2019 +0100

msvcrt: Validate character in _ismbcl0.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcrt/mbcs.c         | 2 +-
 dlls/msvcrt/tests/string.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c
index 4b2d742..a0ce73f 100644
--- a/dlls/msvcrt/mbcs.c
+++ b/dlls/msvcrt/mbcs.c
@@ -2560,7 +2560,7 @@ int CDECL _ismbcl0(unsigned int c)
   if(get_mbcinfo()->mbcodepage == 932)
   {
     /* JIS non-Kanji */
-    return (c >= 0x8140 && c <= 0x889e);
+    return _ismbclegal(c) && c >= 0x8140 && c <= 0x889e;
   }
   return 0;
 }
diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c
index d0cc51b..4574ea7 100644
--- a/dlls/msvcrt/tests/string.c
+++ b/dlls/msvcrt/tests/string.c
@@ -3288,6 +3288,9 @@ static void test__ismbclx(void)
     ret = _ismbcl0(0x8140);
     ok(ret, "got %d\n", ret);
 
+    ret = _ismbcl0(0x817f);
+    ok(!ret, "got %d\n", ret);
+
     _setmbcp(cp);
 }
 




More information about the wine-cvs mailing list