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.
Commit
d9a37eed9536b48a7bc5be5969d0ba907300e7edc3189e349d20d381ff056627
Parent
9eaf484d159c2e6…
1 file changed
+1
+1
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -1209,10 +1209,11 @@ | ||
| 1209 | 1209 | int manifest_is_well_formed(const char *zIn, int nIn){ |
| 1210 | 1210 | int i; |
| 1211 | 1211 | int iRes; |
| 1212 | 1212 | Manifest *pManifest; |
| 1213 | 1213 | Blob copy, errmsg; |
| 1214 | + if( nIn<1 || zIn[nIn-1]!='\n' ) return 0; | |
| 1214 | 1215 | remove_pgp_signature(&zIn, &nIn); |
| 1215 | 1216 | |
| 1216 | 1217 | /* Check to see that the file begins with a "card" */ |
| 1217 | 1218 | if( nIn<3 ) return 0; |
| 1218 | 1219 | if( zIn[0]<'A' || zIn[0]>'M' || zIn[1]!=' ' ) return 0; |
| 1219 | 1220 |
| --- 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 |