Subject: Prevent invalid columnPos() call in formUpdateBuffer() From: Tatsuya Kinoshita Bug-Debian: https://github.com/tats/w3m/issues/89 [CVE-2018-6197] Origin: https://salsa.debian.org/debian/w3m/commit/7fdc83b0364005a0b5ed869230dd81752ba022e8 Index: w3m-0.5.3/form.c =================================================================== --- w3m-0.5.3.orig/form.c 2020-04-29 13:52:58.629142811 +0200 +++ w3m-0.5.3/form.c 2020-04-29 13:52:58.621142209 +0200 @@ -483,6 +483,8 @@ 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);