Fossil SCM

In manifest_is_well_formed(), refuse input that does not end with a newline before removing a PGP signature, as the artifact parser does, so that the two agree on a signed artifact with nothing after its signature.

dmestas 2026-11-20 18:19 UTC small-fixes
Commit d9a37eed9536b48a7bc5be5969d0ba907300e7edc3189e349d20d381ff056627
1 file changed +1
--- src/manifest.c
+++ src/manifest.c
@@ -1209,10 +1209,11 @@
12091209
int manifest_is_well_formed(const char *zIn, int nIn){
12101210
int i;
12111211
int iRes;
12121212
Manifest *pManifest;
12131213
Blob copy, errmsg;
1214
+ if( nIn<1 || zIn[nIn-1]!='\n' ) return 0;
12141215
remove_pgp_signature(&zIn, &nIn);
12151216
12161217
/* Check to see that the file begins with a "card" */
12171218
if( nIn<3 ) return 0;
12181219
if( zIn[0]<'A' || zIn[0]>'M' || zIn[1]!=' ' ) return 0;
12191220
--- src/manifest.c
+++ src/manifest.c
@@ -1209,10 +1209,11 @@
1209 int manifest_is_well_formed(const char *zIn, int nIn){
1210 int i;
1211 int iRes;
1212 Manifest *pManifest;
1213 Blob copy, errmsg;
 
1214 remove_pgp_signature(&zIn, &nIn);
1215
1216 /* Check to see that the file begins with a "card" */
1217 if( nIn<3 ) return 0;
1218 if( zIn[0]<'A' || zIn[0]>'M' || zIn[1]!=' ' ) return 0;
1219
--- src/manifest.c
+++ src/manifest.c
@@ -1209,10 +1209,11 @@
1209 int manifest_is_well_formed(const char *zIn, int nIn){
1210 int i;
1211 int iRes;
1212 Manifest *pManifest;
1213 Blob copy, errmsg;
1214 if( nIn<1 || zIn[nIn-1]!='\n' ) return 0;
1215 remove_pgp_signature(&zIn, &nIn);
1216
1217 /* Check to see that the file begins with a "card" */
1218 if( nIn<3 ) return 0;
1219 if( zIn[0]<'A' || zIn[0]>'M' || zIn[1]!=' ' ) return 0;
1220

Keyboard Shortcuts

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