summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2011-02-09 16:44:51 +0100
committerBram Moolenaar <Bram@vim.org>2011-02-09 16:44:51 +0100
commit95474ca34c542d58d3f08703b7d96ad21b05beea (patch)
tree962c07e26b1f76e766b429ed3d3e72ac48716552 /src/fileio.c
parentba81e4660b155b212fe0a913ca102a510105562b (diff)
downloadvim-git-95474ca34c542d58d3f08703b7d96ad21b05beea.tar.gz
updated for version 7.3.115v7.3.115
Problem: Vim can crash when tmpnam() returns NULL. Solution: Check for NULL. (Hong Xu)
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 1360fde0c..0d4511ad5 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -7483,8 +7483,11 @@ vim_tempname(extra_char)
# else /* WIN3264 */
# ifdef USE_TMPNAM
+ char_u *p;
+
/* tmpnam() will make its own name */
- if (*tmpnam((char *)itmp) == NUL)
+ p = tmpnam((char *)itmp);
+ if (p == NULL || *p == NUL)
return NULL;
# else
char_u *p;