Lines 1-7
Link Here
|
1 |
diff -urN -x .svn ../../vendor/curl/src/main.c ./src/main.c |
1 |
--- src/main.c.orig 2009-02-17 12:10:21.000000000 +0300 |
2 |
--- ../../vendor/curl/src/main.c 2008-10-29 00:12:02.000000000 +0200 |
2 |
+++ src/main.c 2009-03-06 12:42:56.000000000 +0300 |
3 |
+++ ./src/main.c 2009-01-21 16:12:11.000000000 +0200 |
3 |
@@ -4355,31 +4355,32 @@ |
4 |
@@ -4313,31 +4313,32 @@ |
|
|
5 |
(-1 == create_dir_hierarchy(outfile, config->errors))) |
4 |
(-1 == create_dir_hierarchy(outfile, config->errors))) |
6 |
return CURLE_WRITE_ERROR; |
5 |
return CURLE_WRITE_ERROR; |
7 |
|
6 |
|
Lines 52-82
diff -urN -x .svn ../../vendor/curl/src/main.c ./src/main.c
Link Here
|
52 |
} |
51 |
} |
53 |
else { |
52 |
else { |
54 |
outs.stream = NULL; /* open when needed */ |
53 |
outs.stream = NULL; /* open when needed */ |
55 |
@@ -5288,12 +5289,13 @@ |
54 |
@@ -5429,6 +5430,10 @@ |
56 |
static const char * |
|
|
57 |
msdosify (const char *file_name) |
58 |
{ |
59 |
- static char dos_name[PATH_MAX*2]; |
60 |
+ static char dos_name[PATH_MAX + 16]; |
61 |
static const char illegal_chars_dos[] = ".+, ;=[]|<>\\\":?*"; |
62 |
static const char *illegal_chars_w95 = &illegal_chars_dos[8]; |
63 |
int idx, dot_idx; |
64 |
const char *s = file_name; |
65 |
char *d = dos_name; |
66 |
+ char *dlimit = dos_name + PATH_MAX; |
67 |
const char *illegal_aliens = illegal_chars_dos; |
68 |
size_t len = sizeof (illegal_chars_dos) - 1; |
69 |
int lfn = 0; |
70 |
@@ -5314,7 +5316,7 @@ |
71 |
*d++ = *s++; |
72 |
} |
73 |
|
74 |
- for (idx = 0, dot_idx = -1; *s; s++, d++) { |
75 |
+ for (idx = 0, dot_idx = -1; *s && d < dlimit; s++, d++) { |
76 |
if (memchr (illegal_aliens, *s, len)) { |
77 |
/* Dots are special: DOS doesn't allow them as the leading character, |
78 |
and a file name cannot have more than a single dot. We leave the |
79 |
@@ -5371,6 +5373,10 @@ |
80 |
idx++; |
55 |
idx++; |
81 |
} |
56 |
} |
82 |
|
57 |
|