diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2016-08-29 10:28:41 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2016-08-29 10:29:19 +0000 |
commit | 4e464819dd360ffd3d58fa2a89216fe413cfcc74 (patch) | |
tree | 2f91bc09bf6d93bd99109d640512afaf37ad337c | |
parent | Prevent segfault for formUpdateBuffer (diff) | |
download | w3m-4e464819dd360ffd3d58fa2a89216fe413cfcc74.tar.gz w3m-4e464819dd360ffd3d58fa2a89216fe413cfcc74.zip |
Prevent segfault due to buffer overflows in addMultirowsForm
Bug-Debian: https://github.com/tats/w3m/issues/21
Bug-Debian: https://github.com/tats/w3m/issues/26
-rw-r--r-- | anchor.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -685,6 +685,8 @@ addMultirowsForm(Buffer *buf, AnchorList *al) a->hseq = a_form.hseq; a->y = a_form.y; a->end.pos = pos + ecol - col; + if (pos < 1 || a->end.pos >= l->size) + continue; l->lineBuf[pos - 1] = '['; l->lineBuf[a->end.pos] = ']'; for (k = pos; k < a->end.pos; k++) |