Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/mdocml/dist PR/54069: Jason Thorpe: Prevent mem...



details:   https://anonhg.NetBSD.org/src/rev/5a302a109fda
branches:  trunk
changeset: 449912:5a302a109fda
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Mar 28 20:26:49 2019 +0000

description:
PR/54069: Jason Thorpe: Prevent memory overrun. Can be easily reproduced
with groff_ms.7 and -fsanitize=address.

diffstat:

 external/bsd/mdocml/dist/out.c |  3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diffs (13 lines):

diff -r 4bf9da752fc2 -r 5a302a109fda external/bsd/mdocml/dist/out.c
--- a/external/bsd/mdocml/dist/out.c    Thu Mar 28 19:00:40 2019 +0000
+++ b/external/bsd/mdocml/dist/out.c    Thu Mar 28 20:26:49 2019 +0000
@@ -235,6 +235,9 @@
                        } else
                                (*gp)->wanted -= width;
                }
+               if (g->endcol > maxcol) {
+                       maxcol = g->endcol;
+               }
                if (done) {
                        *gp = g->next;
                        free(g);



Home | Main Index | Thread Index | Old Index