diff options
| author | Jaakko Heinonen <jh@FreeBSD.org> | 2010-03-12 06:56:51 +0000 |
|---|---|---|
| committer | Jaakko Heinonen <jh@FreeBSD.org> | 2010-03-12 06:56:51 +0000 |
| commit | 324846ecfa1b8fd110d421572848e8e7194940bf (patch) | |
| tree | 131db6e8fd8925d1bc64971b7af8c26260fe62d8 | |
| parent | cf4bd5e4d96f57c576b1e23183a01b6820e53ff7 (diff) | |
Notes
| -rw-r--r-- | lib/libc/stdio/mktemp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c index 3f1e699f213e..a30b930354e3 100644 --- a/lib/libc/stdio/mktemp.c +++ b/lib/libc/stdio/mktemp.c @@ -116,6 +116,10 @@ _gettemp(path, doopen, domkdir, slen) for (trv = path; *trv != '\0'; ++trv) ; + if (trv - path >= MAXPATHLEN) { + errno = ENAMETOOLONG; + return (0); + } trv -= slen; suffp = trv; --trv; |
