diff options
author | Daniel Stenberg <daniel@haxx.se> | 2010-04-21 23:20:18 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2010-04-21 23:20:18 +0200 |
commit | 71be565cf48f17b21eebbcde1ddba27c6e06d4c5 (patch) | |
tree | 005a3a534fa12ae8a7cc6b8955d7809df38c6bde | |
parent | 81512cc02b92c2d6deaf9461617c89d49f44310f (diff) |
curl: -O crash on windows
The -O option caused curl to crash on windows and DOS due to the
tool writing out of boundary memory.
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | RELEASE-NOTES | 1 | ||||
-rw-r--r-- | src/main.c | 3 |
3 files changed, 7 insertions, 1 deletions
@@ -6,6 +6,10 @@ Changelog +Daniel Stenberg (21 Apr 2010) +- The -O option caused curl to crash on windows and DOS due to the tool + writing out of boundary memory. + Yang Tse (20 Apr 2010) - Ruslan Gazizov detected that MSVC makefiles were using wsock32.lib instead of ws2_32.lib, this generated linking issues on MSVC IPv6 enabled builds diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d180686d8..3c6b52109 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -19,6 +19,7 @@ This release includes the following bugfixes: o GnuTLS: SSL handshake phase is non-blocking o -J/--remote-header-name strips CRLF o MSVC makefiles now use ws2_32.lib instead of wsock32.lib + o -O crash on windows This release includes the following known bugs: diff --git a/src/main.c b/src/main.c index b7e438b1e..2dd6dc873 100644 --- a/src/main.c +++ b/src/main.c @@ -5839,7 +5839,8 @@ rename_if_dos_device_name (char *file_name) static char *sanitize_dos_name(char *fn) { char tmpfn[PATH_MAX]; - fn[PATH_MAX-1]=0; /* ensure fn is not too long by possibly truncating it */ + if(strlen(fn) >= PATH_MAX) + fn[PATH_MAX-1]=0; /* truncate it */ strcpy(tmpfn, msdosify(fn)); free(fn); return strdup(rename_if_dos_device_name(tmpfn)); |