summaryrefslogtreecommitdiffstats
path: root/tbl_data.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-04-23 16:08:33 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-04-23 16:08:33 +0000
commit842d2c18036af60bbed3a3624ecf8fe100d9d443 (patch)
tree2b956214e0aa752af4c2b4e3dc2c4edd7901380a /tbl_data.c
parentfc08cbd658772077746061992d1a10222eab1dff (diff)
downloadmandoc-842d2c18036af60bbed3a3624ecf8fe100d9d443.tar.gz
Audit strlcpy(3)/strlcat(3) usage.
* Repair three instances of silent truncation, use asprintf(3). * Change two instances of strlen(3)+malloc(3)+strlcpy(3)+strlcat(3)+... to use asprintf(3) instead to make them less error prone. * Cast the return value of four instances where the destination buffer is known to be large enough to (void). * Completely remove three useless instances of strlcpy(3)/strlcat(3). * Mark two places in -Thtml with XXX that can cause information loss and crashes but are not easy to fix, requiring design changes of some internal interfaces. * The file mandocdb.c remains to be audited.
Diffstat (limited to 'tbl_data.c')
-rw-r--r--tbl_data.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tbl_data.c b/tbl_data.c
index 89c5741e..331b7f98 100644
--- a/tbl_data.c
+++ b/tbl_data.c
@@ -167,8 +167,8 @@ tbl_cdata(struct tbl_node *tbl, int ln, const char *p)
if (dat->string) {
sz = strlen(p) + strlen(dat->string) + 2;
dat->string = mandoc_realloc(dat->string, sz);
- strlcat(dat->string, " ", sz);
- strlcat(dat->string, p, sz);
+ (void)strlcat(dat->string, " ", sz);
+ (void)strlcat(dat->string, p, sz);
} else
dat->string = mandoc_strdup(p);