diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2019-03-18 08:00:34 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2019-03-18 08:00:34 +0000 |
commit | 5e859b1a66b94c8cf3ee617d521d7031687d509c (patch) | |
tree | 297e2be494dce4f73fa44bc52f528fff36730dcc /tbl_term.c | |
parent | a7dd551919aa760137d514a8e566611fdd1fad50 (diff) | |
download | mandoc-5e859b1a66b94c8cf3ee617d521d7031687d509c.tar.gz mandoc-5e859b1a66b94c8cf3ee617d521d7031687d509c.tar.zst mandoc-5e859b1a66b94c8cf3ee617d521d7031687d509c.zip |
fix a NULL pointer access on empty tbl(7) data cells
that bentley@ found in syncthing-bep(7)
Diffstat (limited to 'tbl_term.c')
-rw-r--r-- | tbl_term.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $Id: tbl_term.c,v 1.69 2019/03/16 21:35:48 schwarze Exp $ */ +/* $Id: tbl_term.c,v 1.70 2019/03/18 08:00:34 schwarze Exp $ */ /* * Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011-2019 Ingo Schwarze <schwarze@openbsd.org> @@ -629,7 +629,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); @@ -675,7 +676,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. */ |