Crashes found by tb@ with afl(1).
-$Id: NEWS,v 1.18 2017/02/11 15:47:16 schwarze Exp $
+$Id: NEWS,v 1.19 2017/02/12 14:19:01 schwarze Exp $
This file lists the most important changes in the mdocml.bsd.lv distribution.
block-end macro calling another block-end macro.
* mdoc(7): Fix NULL dereference if the only child of the head
of the first .Sh was an empty in-line macro.
+ * eqn(7): Fix NULL dereference in the terminal formatter
+ for empty matrices and empty square roots.
* mdoc(7): Fix an assertion failure for a .Bd without a type that
breaks another block.
* mdoc(7): Fix an assertion failure caused by .Bl -column without .It
-/* $Id: eqn_term.c,v 1.8 2015/01/01 15:36:08 schwarze Exp $ */
+/* $Id: eqn_term.c,v 1.9 2017/02/12 14:19:01 schwarze Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
if (bp->pos == EQNPOS_SQRT) {
term_word(p, "sqrt");
- p->flags |= TERMP_NOSPACE;
- eqn_box(p, bp->first);
+ if (bp->first != NULL) {
+ p->flags |= TERMP_NOSPACE;
+ eqn_box(p, bp->first);
+ }
} else if (bp->type == EQN_SUBEXPR) {
child = bp->first;
eqn_box(p, child);
}
} else {
child = bp->first;
- if (bp->type == EQN_MATRIX && child->type == EQN_LIST)
+ if (bp->type == EQN_MATRIX &&
+ child != NULL && child->type == EQN_LIST)
child = child->first;
while (child != NULL) {
eqn_box(p,
# $OpenBSD: Makefile,v 1.1.1.1 2015/01/01 12:53:46 schwarze Exp $
-REGRESS_TARGETS = basic
-HTML_TARGETS = basic
+REGRESS_TARGETS = basic empty
+HTML_TARGETS = basic empty
.include <bsd.regress.mk>
--- /dev/null
+.Dd February 12, 2017
+.Dt MATRIX-EMPTY 1
+.Os OpenBSD
+.Sh NAME
+.Nm matrix-empty
+.Nd empty matrixes
+.Sh DESCRIPTION
+initial text
+.EQ
+left (
+matrix { }
+right )
+left (
+matrix
+right )
+.EN
+final text
--- /dev/null
+MATRIX-EMPTY(1) General Commands Manual MATRIX-EMPTY(1)
+
+N\bNA\bAM\bME\bE
+ m\bma\bat\btr\bri\bix\bx-\b-e\bem\bmp\bpt\bty\by - empty matrixes
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+ initial text () () final text
+
+OpenBSD February 12, 2017 OpenBSD
--- /dev/null
+<mrow><mfenced open="(" close=")"><mrow></mrow></mfenced><mfenced open="(" close=")"><mrow></mrow></mfenced></mrow>
-.Dd October 10, 2014
+.Dd February 12, 2017
.Dt UNARY-SQRT 1
.Os OpenBSD
.Sh NAME
.Sh DESCRIPTION
initial text
.EQ
-r = sqrt { x sup 2 + y sup 2 }
+r = sqrt { x sup 2 + y sup 2 } + sqrt { } + sqrt
.EN
final text
u\bun\bna\bar\bry\by-\b-s\bsq\bqr\brt\bt - square root
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
- initial text r = sqrt(x^2 + y^2) final text
+ initial text r = sqrt(x^2 + y^2) + sqrt() + sqrt final text
-OpenBSD October 10, 2014 OpenBSD
+OpenBSD February 12, 2017 OpenBSD
-<mrow><mi>r</mi><mi>=</mi><msqrt><mrow><msup><mi>x</mi><mi>2</mi></msup><mi>+</mi><msup><mi>y</mi><mi>2</mi></msup></mrow></msqrt></mrow>
+<mrow><mi>r</mi><mi>=</mi><msqrt><mrow><msup><mi>x</mi><mi>2</mi></msup><mi>+</mi><msup><mi>y</mi><mi>2</mi></msup></mrow></msqrt><mi>+</mi><msqrt><mrow></mrow></msqrt><mi>+</mi><msqrt></msqrt></mrow>