diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-12-30 20:41:00 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-12-30 20:41:00 +0000 |
commit | 3d673e1a84f7b7f238eeab1d52469fc06197bce1 (patch) | |
tree | 52c77358bf1adfc3bb923e8999d4b90df2002699 /mandocdb.c | |
parent | f2bf5036897e1d0088721388e2ec0801bebfa074 (diff) | |
download | mandoc-3d673e1a84f7b7f238eeab1d52469fc06197bce1.tar.gz mandoc-3d673e1a84f7b7f238eeab1d52469fc06197bce1.tar.zst mandoc-3d673e1a84f7b7f238eeab1d52469fc06197bce1.zip |
When a file is given on the command line, actually exists, and its name
relative to the respective manual tree is longer than PATH_MAX, do not
leak the memory allocated to hold the name. Not sure that can actually
happen, but better safe than sorry.
FreeBSD Coverity Scan CID 1261303, reported by Pedro Giffuni <pfg@>.
Diffstat (limited to 'mandocdb.c')
-rw-r--r-- | mandocdb.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.179 2014/12/09 07:29:42 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.180 2014/12/30 20:41:00 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -852,6 +852,7 @@ filescan(const char *file) if (strlcpy(mlink->file, start, sizeof(mlink->file)) >= sizeof(mlink->file)) { say(start, "Filename too long"); + free(mlink); return; } |