summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/tbl_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2019-03-18 08:00:27 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2019-03-18 08:00:27 +0000
commitb6b8fb37393a9111c449eadef3a55d9c757901b3 (patch)
tree1a304becec6ff8cadac1c629571798ee60b92709 /usr.bin/mandoc/tbl_term.c
parentfd6240efcd7acdffe8392eded3d836e45f39dead (diff)
fix a NULL pointer access on empty tbl(7) data cells
that bentley@ found in syncthing-bep(7)
Diffstat (limited to 'usr.bin/mandoc/tbl_term.c')
-rw-r--r--usr.bin/mandoc/tbl_term.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/mandoc/tbl_term.c b/usr.bin/mandoc/tbl_term.c
index 31e5ad1b466..c8af6165b5c 100644
--- a/usr.bin/mandoc/tbl_term.c
+++ b/usr.bin/mandoc/tbl_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tbl_term.c,v 1.57 2019/03/16 21:35:11 schwarze Exp $ */
+/* $OpenBSD: tbl_term.c,v 1.58 2019/03/18 08:00:26 schwarze Exp $ */
/*
* Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2019 Ingo Schwarze <schwarze@openbsd.org>
@@ -627,7 +627,8 @@ tbl_hrule(struct termp *tp, const struct tbl_span *spp,
lw = cpp == NULL || cpn == NULL ||
(cpn->pos != TBL_CELL_DOWN &&
- (dpn == NULL || strcmp(dpn->string, "\\^") != 0))
+ (dpn == NULL || dpn->string == NULL ||
+ strcmp(dpn->string, "\\^") != 0))
? hw : 0;
tbl_direct_border(tp, BHORIZ * lw,
col->width + col->spacing / 2);
@@ -673,7 +674,8 @@ tbl_hrule(struct termp *tp, const struct tbl_span *spp,
rw = cpp == NULL || cpn == NULL ||
(cpn->pos != TBL_CELL_DOWN &&
- (dpn == NULL || strcmp(dpn->string, "\\^") != 0))
+ (dpn == NULL || dpn->string == NULL ||
+ strcmp(dpn->string, "\\^") != 0))
? hw : 0;
/* The line crossing at the end of this column. */