diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2016-04-07 21:10:42 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2016-11-19 05:11:40 +0000 |
commit | 9c462fccea06a33d4b9545cd03032105d4899cda (patch) | |
tree | a49f2dba5b7fd1267de5aab34550fdab27f682dd | |
parent | Fix segfault on bogus text (diff) | |
download | w3m-9c462fccea06a33d4b9545cd03032105d4899cda.tar.gz w3m-9c462fccea06a33d4b9545cd03032105d4899cda.zip |
Fix segfault on bogus text for wc_N_to_johab1
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=820373
Origin: https://anonscm.debian.org/cgit/collab-maint/w3m.git/commit/?id=5a159af05d8556a3f9f8f1a42d8fc153ffbc9694
-rw-r--r-- | libwc/johab.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libwc/johab.c b/libwc/johab.c index 8d587b8..498b1bb 100644 --- a/libwc/johab.c +++ b/libwc/johab.c @@ -160,9 +160,9 @@ wc_N_to_johab1(wc_uint32 code) { wc_uint32 a, b, c; - a = N_johab1_map[0][(code / 28) / 21]; - b = N_johab1_map[1][(code / 28) % 21]; - c = N_johab1_map[2][ code % 28 ]; + a = N_johab1_map[0][(code / 28) / 21 & 0x1F]; + b = N_johab1_map[1][(code / 28) % 21 & 0x1F]; + c = N_johab1_map[2][ code % 28 & 0x1F]; return 0x8000 | (a << 10) | (b << 5) | c; } |