Fossil SCM
More work to ensure that UrlData.path is always dynamically allocated.
Commit
6d78082cb594cb7ffda35ba798d6f46e1b6cad545fe4550895830bbb1b15cfad
Parent
b9c9d39df94f0af…
1 file changed
+5
-1
+5
-1
| --- src/url.c | ||
| +++ src/url.c | ||
| @@ -247,11 +247,15 @@ | ||
| 247 | 247 | "%s://%s%T:%d%T%z", |
| 248 | 248 | pUrlData->protocol, zLogin, pUrlData->name, pUrlData->port, |
| 249 | 249 | pUrlData->path, zExe |
| 250 | 250 | ); |
| 251 | 251 | } |
| 252 | - if( pUrlData->isSsh && pUrlData->path[1] ) pUrlData->path++; | |
| 252 | + if( pUrlData->isSsh && pUrlData->path[1] ){ | |
| 253 | + char *zOld = pUrlData->path; | |
| 254 | + pUrlData->path = mprintf("%s", zOld+1); | |
| 255 | + fossil_free(zOld); | |
| 256 | + } | |
| 253 | 257 | free(zLogin); |
| 254 | 258 | }else if( strncmp(zUrl, "file:", 5)==0 ){ |
| 255 | 259 | pUrlData->isFile = 1; |
| 256 | 260 | if( zUrl[5]=='/' && zUrl[6]=='/' ){ |
| 257 | 261 | i = 7; |
| 258 | 262 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -247,11 +247,15 @@ | |
| 247 | "%s://%s%T:%d%T%z", |
| 248 | pUrlData->protocol, zLogin, pUrlData->name, pUrlData->port, |
| 249 | pUrlData->path, zExe |
| 250 | ); |
| 251 | } |
| 252 | if( pUrlData->isSsh && pUrlData->path[1] ) pUrlData->path++; |
| 253 | free(zLogin); |
| 254 | }else if( strncmp(zUrl, "file:", 5)==0 ){ |
| 255 | pUrlData->isFile = 1; |
| 256 | if( zUrl[5]=='/' && zUrl[6]=='/' ){ |
| 257 | i = 7; |
| 258 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -247,11 +247,15 @@ | |
| 247 | "%s://%s%T:%d%T%z", |
| 248 | pUrlData->protocol, zLogin, pUrlData->name, pUrlData->port, |
| 249 | pUrlData->path, zExe |
| 250 | ); |
| 251 | } |
| 252 | if( pUrlData->isSsh && pUrlData->path[1] ){ |
| 253 | char *zOld = pUrlData->path; |
| 254 | pUrlData->path = mprintf("%s", zOld+1); |
| 255 | fossil_free(zOld); |
| 256 | } |
| 257 | free(zLogin); |
| 258 | }else if( strncmp(zUrl, "file:", 5)==0 ){ |
| 259 | pUrlData->isFile = 1; |
| 260 | if( zUrl[5]=='/' && zUrl[6]=='/' ){ |
| 261 | i = 7; |
| 262 |