mirror of
https://github.com/curl/curl.git
synced 2026-08-24 19:03:40 +03:00
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.
This commit is contained in:
parent
81512cc02b
commit
71be565cf4
3 changed files with 7 additions and 1 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue