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 | 034fc65e0973095b716d53e0292987e393d4bfa3 (patch) | |
tree | 7e8fbcd2f9168416e1efd22dda32934be7d6c77e | |
parent | 1c486423eae0c24d583bb28910ba9da5fef3df32 (diff) | |
download | mandoc-034fc65e0973095b716d53e0292987e393d4bfa3.tar.gz |
fix a NULL pointer access on empty tbl(7) data cells
that bentley@ found in syncthing-bep(7)
-rw-r--r-- | tbl_term.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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. */ |