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.

dmestas 2026-11-20 18:17 UTC small-fixes
Commit 9eaf484d159c2e671e507e88a62585f845156009449098eaea875e58df754f0a
1 file changed +2 -1
+2 -1
--- src/manifest.c
+++ src/manifest.c
@@ -1219,11 +1219,12 @@
12191219
12201220
/* Check to see that the first card is followed by one more card */
12211221
for(i=2; i<nIn && zIn[i]!='\n'; i++){}
12221222
if( i>=nIn-3 ) return 0;
12231223
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;
12251226
12261227
/* The checks above will eliminate most random inputs. If these
12271228
** quick checks pass, then we could be dealing with a well-formed
12281229
** control artifact. Make a copy, and run it through the official
12291230
** artifact parser. This is the slow path, but it is rarely taken.
12301231
--- 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

Keyboard Shortcuts

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