From f70b8f0a23e407c18e09dc5acbee7444844839d8 Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Fri, 26 Jan 2018 01:03:39 +0900 Subject: Prevent invalid columnPos() call in formUpdateBuffer() Bug-Debian: https://github.com/tats/w3m/issues/89 [CVE-2018-6197] --- form.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/form.c b/form.c index 0605513..0a71f9c 100644 --- a/form.c +++ b/form.c @@ -483,6 +483,8 @@ formUpdateBuffer(Anchor *a, Buffer *buf, FormItemList *form) rows = form->rows ? form->rows : 1; col = COLPOS(l, a->start.pos); for (c_rows = 0; c_rows < rows; c_rows++, l = l->next) { + if (l == NULL) + break; if (rows > 1) { pos = columnPos(l, col); a = retrieveAnchor(buf->formitem, l->linenumber, pos); -- cgit v1.2.3