summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2011-12-14 20:00:34 +0100
committernulltoken <emeric.fermas@gmail.com>2011-12-14 20:03:11 +0100
commit489c36663e0998cf558f2bb1fe595919851d1164 (patch)
treed903918603c6f570342e424b06bb2da0e47a3130 /src
parent16a9f32abd9b038cb07e419e646ebf3aab520796 (diff)
downloadlibgit2-489c36663e0998cf558f2bb1fe595919851d1164.tar.gz
posix_w32: prevent segfaulting on Windows when building a temporary filename
Diffstat (limited to 'src')
-rw-r--r--src/win32/posix_w32.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/win32/posix_w32.c b/src/win32/posix_w32.c
index e406a8f6c..00016542d 100644
--- a/src/win32/posix_w32.c
+++ b/src/win32/posix_w32.c
@@ -365,7 +365,7 @@ extern int p_creat(const char *path, mode_t mode);
int p_mkstemp(char *tmp_path)
{
#if defined(_MSC_VER)
- if (_mktemp_s(tmp_path, GIT_PATH_MAX) != 0)
+ if (_mktemp_s(tmp_path, strlen(tmp_path) + 1) != 0)
return GIT_EOSERR;
#else
if (_mktemp(tmp_path) == NULL)