diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2016-11-14 12:01:08 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2016-11-19 12:25:59 +0000 |
commit | 500e08adcd54bc033a97710aadc844bcea143be1 (patch) | |
tree | 087a1b7b70c7c4430eb324c45dc09a1f24a1ef60 /symbol.c | |
parent | Check indent_level to prevent infinite recursion (diff) | |
download | w3m-500e08adcd54bc033a97710aadc844bcea143be1.tar.gz w3m-500e08adcd54bc033a97710aadc844bcea143be1.zip |
Prevent array index out of bounds for symbol
Bug-Debian: https://github.com/tats/w3m/issues/38
Origin: https://anonscm.debian.org/cgit/collab-maint/w3m.git/commit/?id=0c3f5d0e0d9269ad47b8f4b061d7818993913189
Diffstat (limited to 'symbol.c')
-rw-r--r-- | symbol.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -176,10 +176,10 @@ push_symbol(Str str, char symbol, int width, int n) #ifdef USE_M17N if (width == 2) - p = alt2_symbol[(int)symbol]; + p = alt2_symbol[(unsigned char)symbol % N_SYMBOL]; else #endif - p = alt_symbol[(int)symbol]; + p = alt_symbol[(unsigned char)symbol % N_SYMBOL]; for (i = 0; i < 2 && *p; i++, p++) buf[i] = (*p == ' ') ? NBSP_CODE : *p; |