diff options
| author | Jaakko Heinonen <jh@FreeBSD.org> | 2010-03-19 12:04:56 +0000 |
|---|---|---|
| committer | Jaakko Heinonen <jh@FreeBSD.org> | 2010-03-19 12:04:56 +0000 |
| commit | a3155d529b95e5ab6455dd12d627838d60900064 (patch) | |
| tree | d4170f3caba78123aa876c1107b262ea8d78f068 /lib | |
| parent | f241007553f41562f231f742e5d8027f51812180 (diff) | |
Notes
Diffstat (limited to 'lib')
| -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 51a2d05775c7..b55f3a3f6f05 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; |
