Fossil SCM
In set_base_url(), look at the second byte of the path from --baseurl only when there is a first, so that a base URL with no path is not read past its end.
Commit
210e9def6f68dd34bacaf7ccf5a0d2fac7400d3ee93a545ca4f591c0bc9732f7
Parent
7dfed212f8b0951…
1 file changed
+1
-1
+1
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -1455,11 +1455,11 @@ | ||
| 1455 | 1455 | if( n==2 ) g.zTop = ""; |
| 1456 | 1456 | if( g.zTop==g.zBaseURL ){ |
| 1457 | 1457 | fossil_fatal("argument to --baseurl should be 'http://host/path'" |
| 1458 | 1458 | " or 'https://host/path'"); |
| 1459 | 1459 | } |
| 1460 | - if( g.zTop[1]==0 ) g.zTop++; | |
| 1460 | + if( g.zTop[0] && g.zTop[1]==0 ) g.zTop++; | |
| 1461 | 1461 | }else{ |
| 1462 | 1462 | char *z; |
| 1463 | 1463 | zMode = PD("HTTPS","off"); |
| 1464 | 1464 | zHost = PD("HTTP_HOST",""); |
| 1465 | 1465 | z = fossil_strdup(zHost); |
| 1466 | 1466 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1455,11 +1455,11 @@ | |
| 1455 | if( n==2 ) g.zTop = ""; |
| 1456 | if( g.zTop==g.zBaseURL ){ |
| 1457 | fossil_fatal("argument to --baseurl should be 'http://host/path'" |
| 1458 | " or 'https://host/path'"); |
| 1459 | } |
| 1460 | if( g.zTop[1]==0 ) g.zTop++; |
| 1461 | }else{ |
| 1462 | char *z; |
| 1463 | zMode = PD("HTTPS","off"); |
| 1464 | zHost = PD("HTTP_HOST",""); |
| 1465 | z = fossil_strdup(zHost); |
| 1466 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1455,11 +1455,11 @@ | |
| 1455 | if( n==2 ) g.zTop = ""; |
| 1456 | if( g.zTop==g.zBaseURL ){ |
| 1457 | fossil_fatal("argument to --baseurl should be 'http://host/path'" |
| 1458 | " or 'https://host/path'"); |
| 1459 | } |
| 1460 | if( g.zTop[0] && g.zTop[1]==0 ) g.zTop++; |
| 1461 | }else{ |
| 1462 | char *z; |
| 1463 | zMode = PD("HTTPS","off"); |
| 1464 | zHost = PD("HTTP_HOST",""); |
| 1465 | z = fossil_strdup(zHost); |
| 1466 |