cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 21 Apr 2010 22:53:15 +0200 (CEST)

On Wed, 21 Apr 2010, Jon wrote:

> #10 0x004073bf in operate (config=0x22fd40, argc=3, argv=0x3923f0)
> at main.c:4630
> 4630 outfile = sanitize_dos_name(outfile);
> $1 = 0x39c820 "tip.tar.bz2"

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));

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
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