Fossil SCM
Allow arguments with non-ASCII characters for constructed shell commands.
Commit
72e4b915fd9e8aa8f992679a47c786e589046afc46700c6037dbecb3862d7b5a
Parent
02367341b6944d1…
1 file changed
+2
-1
+2
-1
| --- src/blob.c | ||
| +++ src/blob.c | ||
| @@ -1263,11 +1263,12 @@ | ||
| 1263 | 1263 | #else |
| 1264 | 1264 | const char cQuote = '\''; /* Use '...' quoting on unix */ |
| 1265 | 1265 | #endif |
| 1266 | 1266 | |
| 1267 | 1267 | for(i=0; (c = zIn[i])!=0; i++){ |
| 1268 | - if( c==cQuote || c=='\\' || c<' ' || c==';' || c=='*' || c=='?' || c=='[') { | |
| 1268 | + if( c==cQuote || (unsigned char)c<' ' || | |
| 1269 | + c=='\\' || c==';' || c=='*' || c=='?' || c=='[' ){ | |
| 1269 | 1270 | Blob bad; |
| 1270 | 1271 | blob_token(pBlob, &bad); |
| 1271 | 1272 | fossil_fatal("the [%s] argument to the \"%s\" command contains " |
| 1272 | 1273 | "a character (ascii 0x%02x) that is a security risk", |
| 1273 | 1274 | zIn, blob_str(&bad), c); |
| 1274 | 1275 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -1263,11 +1263,12 @@ | |
| 1263 | #else |
| 1264 | const char cQuote = '\''; /* Use '...' quoting on unix */ |
| 1265 | #endif |
| 1266 | |
| 1267 | for(i=0; (c = zIn[i])!=0; i++){ |
| 1268 | if( c==cQuote || c=='\\' || c<' ' || c==';' || c=='*' || c=='?' || c=='[') { |
| 1269 | Blob bad; |
| 1270 | blob_token(pBlob, &bad); |
| 1271 | fossil_fatal("the [%s] argument to the \"%s\" command contains " |
| 1272 | "a character (ascii 0x%02x) that is a security risk", |
| 1273 | zIn, blob_str(&bad), c); |
| 1274 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -1263,11 +1263,12 @@ | |
| 1263 | #else |
| 1264 | const char cQuote = '\''; /* Use '...' quoting on unix */ |
| 1265 | #endif |
| 1266 | |
| 1267 | for(i=0; (c = zIn[i])!=0; i++){ |
| 1268 | if( c==cQuote || (unsigned char)c<' ' || |
| 1269 | c=='\\' || c==';' || c=='*' || c=='?' || c=='[' ){ |
| 1270 | Blob bad; |
| 1271 | blob_token(pBlob, &bad); |
| 1272 | fossil_fatal("the [%s] argument to the \"%s\" command contains " |
| 1273 | "a character (ascii 0x%02x) that is a security risk", |
| 1274 | zIn, blob_str(&bad), c); |
| 1275 |