diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2016-12-04 16:31:30 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2016-12-05 12:48:30 +0000 |
commit | d7f55d5959c3e06e9f110f13def7ae9015882e1e (patch) | |
tree | e024abf3d64442b13b086c676c1c130eba56667d | |
parent | Prevent negative array index for marks in HTMLlineproc2body() (diff) | |
download | w3m-d7f55d5959c3e06e9f110f13def7ae9015882e1e.tar.gz w3m-d7f55d5959c3e06e9f110f13def7ae9015882e1e.zip |
Prevent negative array index in process_textarea()
Bug-Debian: https://github.com/tats/w3m/issues/58
-rw-r--r-- | file.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -4012,7 +4012,7 @@ process_textarea(struct parsed_tag *tag, int width) cur_textarea_size = 20; if (parsedtag_get_value(tag, ATTR_COLS, &p)) { cur_textarea_size = atoi(p); - if (p[strlen(p) - 1] == '%') + if (strlen(p) > 0 && p[strlen(p) - 1] == '%') cur_textarea_size = width * cur_textarea_size / 100 - 2; if (cur_textarea_size <= 0) { cur_textarea_size = 20; |