Fossil SCM

Allow arguments with non-ASCII characters for constructed shell commands.

drh 2019-02-18 20:44 trunk merge
Commit 72e4b915fd9e8aa8f992679a47c786e589046afc46700c6037dbecb3862d7b5a
1 file changed +2 -1
+2 -1
--- src/blob.c
+++ src/blob.c
@@ -1263,11 +1263,12 @@
12631263
#else
12641264
const char cQuote = '\''; /* Use '...' quoting on unix */
12651265
#endif
12661266
12671267
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=='[' ){
12691270
Blob bad;
12701271
blob_token(pBlob, &bad);
12711272
fossil_fatal("the [%s] argument to the \"%s\" command contains "
12721273
"a character (ascii 0x%02x) that is a security risk",
12731274
zIn, blob_str(&bad), c);
12741275
--- 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

Keyboard Shortcuts

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