Fossil SCM
Fix bug mentioned in [forum:a4c682e21ce329fe] to make URL parser require properly formed URL containing a slash following the port.
Commit
fb752a04f5cb974b0ad4b3e6b358abc68b02efef7ee090dea5f49b0a48eef2d2
Parent
3a2b13b8d0c9a93…
1 file changed
+1
+1
| --- src/url.c | ||
| +++ src/url.c | ||
| @@ -196,10 +196,11 @@ | ||
| 196 | 196 | i++; |
| 197 | 197 | while( (c = zUrl[i])!=0 && fossil_isdigit(c) ){ |
| 198 | 198 | pUrlData->port = pUrlData->port*10 + c - '0'; |
| 199 | 199 | i++; |
| 200 | 200 | } |
| 201 | + if( c!=0 && c!='/' ) fossil_fatal("url missing '/' after port number"); | |
| 201 | 202 | pUrlData->hostname = mprintf("%s:%d", pUrlData->name, pUrlData->port); |
| 202 | 203 | }else{ |
| 203 | 204 | pUrlData->port = pUrlData->dfltPort; |
| 204 | 205 | pUrlData->hostname = pUrlData->name; |
| 205 | 206 | } |
| 206 | 207 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -196,10 +196,11 @@ | |
| 196 | i++; |
| 197 | while( (c = zUrl[i])!=0 && fossil_isdigit(c) ){ |
| 198 | pUrlData->port = pUrlData->port*10 + c - '0'; |
| 199 | i++; |
| 200 | } |
| 201 | pUrlData->hostname = mprintf("%s:%d", pUrlData->name, pUrlData->port); |
| 202 | }else{ |
| 203 | pUrlData->port = pUrlData->dfltPort; |
| 204 | pUrlData->hostname = pUrlData->name; |
| 205 | } |
| 206 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -196,10 +196,11 @@ | |
| 196 | i++; |
| 197 | while( (c = zUrl[i])!=0 && fossil_isdigit(c) ){ |
| 198 | pUrlData->port = pUrlData->port*10 + c - '0'; |
| 199 | i++; |
| 200 | } |
| 201 | if( c!=0 && c!='/' ) fossil_fatal("url missing '/' after port number"); |
| 202 | pUrlData->hostname = mprintf("%s:%d", pUrlData->name, pUrlData->port); |
| 203 | }else{ |
| 204 | pUrlData->port = pUrlData->dfltPort; |
| 205 | pUrlData->hostname = pUrlData->name; |
| 206 | } |
| 207 |