aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-08-01 13:46:15 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-08-01 13:46:15 +0000
commit282fe21ce6f22578f85b7b8addcd20b3f99f40fe (patch)
tree82aebd7269da6b9c89988bc7aee84449d87ed991
parente94e6c316abb2fdc87bef1a5d95cfb29261efc4e (diff)
downloadmandoc-282fe21ce6f22578f85b7b8addcd20b3f99f40fe.tar.gz
mandoc-282fe21ce6f22578f85b7b8addcd20b3f99f40fe.tar.zst
mandoc-282fe21ce6f22578f85b7b8addcd20b3f99f40fe.zip
Avoid a read access one byte beyond the end of an allocated string
which occurred in situations like ".Fl a Cm --"; found by Leah Neukirchen <leah at vuxu dot org> with valgrind on Void Linux.
-rw-r--r--NEWS6
-rw-r--r--mdoc_validate.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 2bd4fab7..a71e41ca 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-$Id: NEWS,v 1.29 2018/07/31 15:34:00 schwarze Exp $
+$Id: NEWS,v 1.30 2018/08/01 13:46:15 schwarze Exp $
This file lists the most important changes in the mandoc.bsd.lv distribution.
@@ -59,8 +59,8 @@ Changes in version 1.14.4, released on August XXX, 2018
on diagnostic messages and on the documentation.
* Thomas Klausner (NetBSD) for suggesting two new style messages,
one new feature, and for two bug reports.
- * Leah Neukirchen (Void Linux) for suggesting a new style message
- and for two bug reports.
+ * Leah Neukirchen (Void Linux) for suggesting a new style message,
+ four bug reports, and release testing.
* Anthony Bentley (OpenBSD) for reporting multiple bugs and missing
features.
* Paul Irofti (OpenBSD) and Nate Bargmann for suggesting new features.
diff --git a/mdoc_validate.c b/mdoc_validate.c
index d455523e..f4381800 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.358 2018/04/11 17:11:13 schwarze Exp $ */
+/* $Id: mdoc_validate.c,v 1.359 2018/08/01 13:46:15 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -440,7 +440,7 @@ check_text_em(struct roff_man *mdoc, int ln, int pos, char *p)
np->string != '\0' &&
isalpha((unsigned char)np->string[
strlen(np->string) - 1])) ||
- (cp[2] != '\0' ?
+ (cp[1] != '\0' && cp[2] != '\0' ?
isalpha((unsigned char)cp[2]) :
nn != NULL &&
nn->type == ROFFT_TEXT &&