Fossil SCM

In url_parse_local(), do not strip the leading character of an empty ssh: path, which read one byte past its allocation.

dmestas 2026-11-21 15:08 UTC small-fixes
Commit d57dbc4b5fc94f8060e07be6868580e3568902d663d206195d027be41ceeecfb
1 file changed +1 -1
+1 -1
--- src/url.c
+++ src/url.c
@@ -309,11 +309,11 @@
309309
"%s://%s%s%T%s:%d%T%z",
310310
pUrlData->protocol, zLogin, zLb, pUrlData->name, zRb,
311311
pUrlData->port, pUrlData->path, zExe
312312
);
313313
}
314
- if( pUrlData->isSsh && pUrlData->path[1] ){
314
+ if( pUrlData->isSsh && pUrlData->path[0] && pUrlData->path[1] ){
315315
char *zOld = pUrlData->path;
316316
pUrlData->path = fossil_strdup(zOld+1);
317317
fossil_free(zOld);
318318
}
319319
free(zLogin);
320320
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button