Fossil SCM
When a client keeps the links a server sends, parse a link only if it begins with http:// or https://. Any other text was parsed as a path on the client and, if no repository was there, ended the sync with an error.
Commit
77cabadca801cf562a2998fd47f6d7684cf7c6ce7a635bfbd34e98a7ea0b1425
Parent
932a61d43875cf7…
1 file changed
+5
-1
+5
-1
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -3000,11 +3000,15 @@ | ||
| 3000 | 3000 | char *zArg = blob_str(&xfer.aToken[3]); |
| 3001 | 3001 | i64 iTime = strtoll(blob_str(&xfer.aToken[4]),0,0); |
| 3002 | 3002 | memset(&x, 0, sizeof(x)); |
| 3003 | 3003 | defossilize(zUrl); |
| 3004 | 3004 | defossilize(zArg); |
| 3005 | - url_parse_local(zUrl, URL_OMIT_USER, &x); | |
| 3005 | + if( fossil_strnicmp(zUrl, "http://", 7)==0 | |
| 3006 | + || fossil_strnicmp(zUrl, "https://", 8)==0 | |
| 3007 | + ){ | |
| 3008 | + url_parse_local(zUrl, URL_OMIT_USER, &x); | |
| 3009 | + } | |
| 3006 | 3010 | if( x.protocol |
| 3007 | 3011 | && strncmp(x.protocol,"http",4)==0 |
| 3008 | 3012 | && iTime>0 |
| 3009 | 3013 | ){ |
| 3010 | 3014 | db_unprotect(PROTECT_CONFIG); |
| 3011 | 3015 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -3000,11 +3000,15 @@ | |
| 3000 | char *zArg = blob_str(&xfer.aToken[3]); |
| 3001 | i64 iTime = strtoll(blob_str(&xfer.aToken[4]),0,0); |
| 3002 | memset(&x, 0, sizeof(x)); |
| 3003 | defossilize(zUrl); |
| 3004 | defossilize(zArg); |
| 3005 | url_parse_local(zUrl, URL_OMIT_USER, &x); |
| 3006 | if( x.protocol |
| 3007 | && strncmp(x.protocol,"http",4)==0 |
| 3008 | && iTime>0 |
| 3009 | ){ |
| 3010 | db_unprotect(PROTECT_CONFIG); |
| 3011 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -3000,11 +3000,15 @@ | |
| 3000 | char *zArg = blob_str(&xfer.aToken[3]); |
| 3001 | i64 iTime = strtoll(blob_str(&xfer.aToken[4]),0,0); |
| 3002 | memset(&x, 0, sizeof(x)); |
| 3003 | defossilize(zUrl); |
| 3004 | defossilize(zArg); |
| 3005 | if( fossil_strnicmp(zUrl, "http://", 7)==0 |
| 3006 | || fossil_strnicmp(zUrl, "https://", 8)==0 |
| 3007 | ){ |
| 3008 | url_parse_local(zUrl, URL_OMIT_USER, &x); |
| 3009 | } |
| 3010 | if( x.protocol |
| 3011 | && strncmp(x.protocol,"http",4)==0 |
| 3012 | && iTime>0 |
| 3013 | ){ |
| 3014 | db_unprotect(PROTECT_CONFIG); |
| 3015 |