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/993e352ee6e0
branches:  trunk
changeset: 840225:993e352ee6e0
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 f57ec51cf769 -r 993e352ee6e0 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