Fossil SCM
In url_parse_local(), do not strip the leading character of an empty ssh: path, which read one byte past its allocation.
Commit
d57dbc4b5fc94f8060e07be6868580e3568902d663d206195d027be41ceeecfb
Parent
26b61eb3223648f…
1 file changed
+1
-1
+1
-1
| --- src/url.c | ||
| +++ src/url.c | ||
| @@ -309,11 +309,11 @@ | ||
| 309 | 309 | "%s://%s%s%T%s:%d%T%z", |
| 310 | 310 | pUrlData->protocol, zLogin, zLb, pUrlData->name, zRb, |
| 311 | 311 | pUrlData->port, pUrlData->path, zExe |
| 312 | 312 | ); |
| 313 | 313 | } |
| 314 | - if( pUrlData->isSsh && pUrlData->path[1] ){ | |
| 314 | + if( pUrlData->isSsh && pUrlData->path[0] && pUrlData->path[1] ){ | |
| 315 | 315 | char *zOld = pUrlData->path; |
| 316 | 316 | pUrlData->path = fossil_strdup(zOld+1); |
| 317 | 317 | fossil_free(zOld); |
| 318 | 318 | } |
| 319 | 319 | free(zLogin); |
| 320 | 320 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -309,11 +309,11 @@ | |
| 309 | "%s://%s%s%T%s:%d%T%z", |
| 310 | pUrlData->protocol, zLogin, zLb, pUrlData->name, zRb, |
| 311 | pUrlData->port, pUrlData->path, zExe |
| 312 | ); |
| 313 | } |
| 314 | if( pUrlData->isSsh && pUrlData->path[1] ){ |
| 315 | char *zOld = pUrlData->path; |
| 316 | pUrlData->path = fossil_strdup(zOld+1); |
| 317 | fossil_free(zOld); |
| 318 | } |
| 319 | free(zLogin); |
| 320 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -309,11 +309,11 @@ | |
| 309 | "%s://%s%s%T%s:%d%T%z", |
| 310 | pUrlData->protocol, zLogin, zLb, pUrlData->name, zRb, |
| 311 | pUrlData->port, pUrlData->path, zExe |
| 312 | ); |
| 313 | } |
| 314 | if( pUrlData->isSsh && pUrlData->path[0] && pUrlData->path[1] ){ |
| 315 | char *zOld = pUrlData->path; |
| 316 | pUrlData->path = fossil_strdup(zOld+1); |
| 317 | fossil_free(zOld); |
| 318 | } |
| 319 | free(zLogin); |
| 320 |