aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/regress
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-02-12 14:19:01 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-02-12 14:19:01 +0000
commita0500c3d4259db15e5b11c0d7cded19840efa3e5 (patch)
tree1ea318c3be442230bd17a32f9e47ff68e7e47449 /regress
parent751954a95b11620a0729815eee5feeaa166a265c (diff)
downloadmandoc-a0500c3d4259db15e5b11c0d7cded19840efa3e5.tar.gz
mandoc-a0500c3d4259db15e5b11c0d7cded19840efa3e5.tar.zst
mandoc-a0500c3d4259db15e5b11c0d7cded19840efa3e5.zip
Do not access a NULL pointer if a matrix or square root are empty.
Crashes found by tb@ with afl(1).
Diffstat (limited to 'regress')
-rw-r--r--regress/eqn/matrix/Makefile4
-rw-r--r--regress/eqn/matrix/empty.in17
-rw-r--r--regress/eqn/matrix/empty.out_ascii9
-rw-r--r--regress/eqn/matrix/empty.out_html1
-rw-r--r--regress/eqn/unary/sqrt.in4
-rw-r--r--regress/eqn/unary/sqrt.out_ascii4
-rw-r--r--regress/eqn/unary/sqrt.out_html2
7 files changed, 34 insertions, 7 deletions
diff --git a/regress/eqn/matrix/Makefile b/regress/eqn/matrix/Makefile
index a48306f2..8c2b50bb 100644
--- a/regress/eqn/matrix/Makefile
+++ b/regress/eqn/matrix/Makefile
@@ -1,6 +1,6 @@
# $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>
diff --git a/regress/eqn/matrix/empty.in b/regress/eqn/matrix/empty.in
new file mode 100644
index 00000000..fda70b2f
--- /dev/null
+++ b/regress/eqn/matrix/empty.in
@@ -0,0 +1,17 @@
+.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
diff --git a/regress/eqn/matrix/empty.out_ascii b/regress/eqn/matrix/empty.out_ascii
new file mode 100644
index 00000000..ca555848
--- /dev/null
+++ b/regress/eqn/matrix/empty.out_ascii
@@ -0,0 +1,9 @@
+MATRIX-EMPTY(1) General Commands Manual MATRIX-EMPTY(1)
+
+NNAAMMEE
+ mmaattrriixx--eemmppttyy - empty matrixes
+
+DDEESSCCRRIIPPTTIIOONN
+ initial text () () final text
+
+OpenBSD February 12, 2017 OpenBSD
diff --git a/regress/eqn/matrix/empty.out_html b/regress/eqn/matrix/empty.out_html
new file mode 100644
index 00000000..4578d361
--- /dev/null
+++ b/regress/eqn/matrix/empty.out_html
@@ -0,0 +1 @@
+<mrow><mfenced open="(" close=")"><mrow></mrow></mfenced><mfenced open="(" close=")"><mrow></mrow></mfenced></mrow>
diff --git a/regress/eqn/unary/sqrt.in b/regress/eqn/unary/sqrt.in
index 359c3d7b..b416da7c 100644
--- a/regress/eqn/unary/sqrt.in
+++ b/regress/eqn/unary/sqrt.in
@@ -1,4 +1,4 @@
-.Dd October 10, 2014
+.Dd February 12, 2017
.Dt UNARY-SQRT 1
.Os OpenBSD
.Sh NAME
@@ -7,6 +7,6 @@
.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
diff --git a/regress/eqn/unary/sqrt.out_ascii b/regress/eqn/unary/sqrt.out_ascii
index 104df229..f109b770 100644
--- a/regress/eqn/unary/sqrt.out_ascii
+++ b/regress/eqn/unary/sqrt.out_ascii
@@ -4,6 +4,6 @@ NNAAMMEE
uunnaarryy--ssqqrrtt - square root
DDEESSCCRRIIPPTTIIOONN
- 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
diff --git a/regress/eqn/unary/sqrt.out_html b/regress/eqn/unary/sqrt.out_html
index b868474d..a828ff1d 100644
--- a/regress/eqn/unary/sqrt.out_html
+++ b/regress/eqn/unary/sqrt.out_html
@@ -1 +1 @@
-<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>