cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl 7.20.1 on windows 7 crash using remote-name

From: Kamil Dudka <kdudka_at_redhat.com>
Date: Wed, 21 Apr 2010 23:06:20 +0200

On Wednesday 21 of April 2010 22:53:15 Daniel Stenberg wrote:
> Try this patch:
>
> --- 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));

+1, I've just tried exactly this a second ago ;-)

Kamil
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-04-21