Fossil SCM
In manifest_is_well_formed(), accept a second card that has no argument, such as an empty P-card, which the artifact parser accepts. Otherwise import --git did not sterilize a file holding such an artifact, and the rebuild made it a real one.
Commit
9eaf484d159c2e671e507e88a62585f845156009449098eaea875e58df754f0a
Parent
dfe9fb28251f50c…
1 file changed
+2
-1
+2
-1
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -1219,11 +1219,12 @@ | ||
| 1219 | 1219 | |
| 1220 | 1220 | /* Check to see that the first card is followed by one more card */ |
| 1221 | 1221 | for(i=2; i<nIn && zIn[i]!='\n'; i++){} |
| 1222 | 1222 | if( i>=nIn-3 ) return 0; |
| 1223 | 1223 | i++; |
| 1224 | - if( !fossil_isupper(zIn[i]) || zIn[i]<zIn[0] || zIn[i+1]!=' ' ) return 0; | |
| 1224 | + if( !fossil_isupper(zIn[i]) || zIn[i]<zIn[0] ) return 0; | |
| 1225 | + if( zIn[i+1]!=' ' && zIn[i+1]!='\n' ) return 0; | |
| 1225 | 1226 | |
| 1226 | 1227 | /* The checks above will eliminate most random inputs. If these |
| 1227 | 1228 | ** quick checks pass, then we could be dealing with a well-formed |
| 1228 | 1229 | ** control artifact. Make a copy, and run it through the official |
| 1229 | 1230 | ** artifact parser. This is the slow path, but it is rarely taken. |
| 1230 | 1231 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1219,11 +1219,12 @@ | |
| 1219 | |
| 1220 | /* Check to see that the first card is followed by one more card */ |
| 1221 | for(i=2; i<nIn && zIn[i]!='\n'; i++){} |
| 1222 | if( i>=nIn-3 ) return 0; |
| 1223 | i++; |
| 1224 | if( !fossil_isupper(zIn[i]) || zIn[i]<zIn[0] || zIn[i+1]!=' ' ) return 0; |
| 1225 | |
| 1226 | /* The checks above will eliminate most random inputs. If these |
| 1227 | ** quick checks pass, then we could be dealing with a well-formed |
| 1228 | ** control artifact. Make a copy, and run it through the official |
| 1229 | ** artifact parser. This is the slow path, but it is rarely taken. |
| 1230 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1219,11 +1219,12 @@ | |
| 1219 | |
| 1220 | /* Check to see that the first card is followed by one more card */ |
| 1221 | for(i=2; i<nIn && zIn[i]!='\n'; i++){} |
| 1222 | if( i>=nIn-3 ) return 0; |
| 1223 | i++; |
| 1224 | if( !fossil_isupper(zIn[i]) || zIn[i]<zIn[0] ) return 0; |
| 1225 | if( zIn[i+1]!=' ' && zIn[i+1]!='\n' ) return 0; |
| 1226 | |
| 1227 | /* The checks above will eliminate most random inputs. If these |
| 1228 | ** quick checks pass, then we could be dealing with a well-formed |
| 1229 | ** control artifact. Make a copy, and run it through the official |
| 1230 | ** artifact parser. This is the slow path, but it is rarely taken. |
| 1231 |