Fossil SCM
Fixed [17d00c20dd9f] by adding NULL check on F- and E-card UUID tokens.
Commit
458f30fc0b36026af3a3652d7f3156bc10aace4bd7a75095b023a27b9ae00e0a
Parent
4ed1a294ff5b90e…
1 file changed
+2
+2
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -610,10 +610,11 @@ | ||
| 610 | 610 | case 'E': { |
| 611 | 611 | if( p->rEventDate>0.0 ) SYNTAX("more than one E-card"); |
| 612 | 612 | p->rEventDate = db_double(0.0,"SELECT julianday(%Q)", next_token(&x,0)); |
| 613 | 613 | if( p->rEventDate<=0.0 ) SYNTAX("malformed date on E-card"); |
| 614 | 614 | p->zEventId = next_token(&x, &sz); |
| 615 | + if( p->zEventId==0 ) SYNTAX("missing hash on E-card"); | |
| 615 | 616 | if( !hname_validate(p->zEventId, sz) ){ |
| 616 | 617 | SYNTAX("malformed hash on E-card"); |
| 617 | 618 | } |
| 618 | 619 | p->type = CFTYPE_EVENT; |
| 619 | 620 | break; |
| @@ -636,10 +637,11 @@ | ||
| 636 | 637 | }else if( filename_is_ckout_db(zName,-1) ){ |
| 637 | 638 | SYNTAX("F-card contains reserved name of a checkout db."); |
| 638 | 639 | } |
| 639 | 640 | zUuid = next_token(&x, &sz); |
| 640 | 641 | if( p->zBaseline==0 || zUuid!=0 ){ |
| 642 | + if( zUuid==0 ) SYNTAX("missing hash on F-card"); | |
| 641 | 643 | if( !hname_validate(zUuid,sz) ){ |
| 642 | 644 | SYNTAX("F-card hash invalid"); |
| 643 | 645 | } |
| 644 | 646 | } |
| 645 | 647 | zPerm = next_token(&x,0); |
| 646 | 648 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -610,10 +610,11 @@ | |
| 610 | case 'E': { |
| 611 | if( p->rEventDate>0.0 ) SYNTAX("more than one E-card"); |
| 612 | p->rEventDate = db_double(0.0,"SELECT julianday(%Q)", next_token(&x,0)); |
| 613 | if( p->rEventDate<=0.0 ) SYNTAX("malformed date on E-card"); |
| 614 | p->zEventId = next_token(&x, &sz); |
| 615 | if( !hname_validate(p->zEventId, sz) ){ |
| 616 | SYNTAX("malformed hash on E-card"); |
| 617 | } |
| 618 | p->type = CFTYPE_EVENT; |
| 619 | break; |
| @@ -636,10 +637,11 @@ | |
| 636 | }else if( filename_is_ckout_db(zName,-1) ){ |
| 637 | SYNTAX("F-card contains reserved name of a checkout db."); |
| 638 | } |
| 639 | zUuid = next_token(&x, &sz); |
| 640 | if( p->zBaseline==0 || zUuid!=0 ){ |
| 641 | if( !hname_validate(zUuid,sz) ){ |
| 642 | SYNTAX("F-card hash invalid"); |
| 643 | } |
| 644 | } |
| 645 | zPerm = next_token(&x,0); |
| 646 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -610,10 +610,11 @@ | |
| 610 | case 'E': { |
| 611 | if( p->rEventDate>0.0 ) SYNTAX("more than one E-card"); |
| 612 | p->rEventDate = db_double(0.0,"SELECT julianday(%Q)", next_token(&x,0)); |
| 613 | if( p->rEventDate<=0.0 ) SYNTAX("malformed date on E-card"); |
| 614 | p->zEventId = next_token(&x, &sz); |
| 615 | if( p->zEventId==0 ) SYNTAX("missing hash on E-card"); |
| 616 | if( !hname_validate(p->zEventId, sz) ){ |
| 617 | SYNTAX("malformed hash on E-card"); |
| 618 | } |
| 619 | p->type = CFTYPE_EVENT; |
| 620 | break; |
| @@ -636,10 +637,11 @@ | |
| 637 | }else if( filename_is_ckout_db(zName,-1) ){ |
| 638 | SYNTAX("F-card contains reserved name of a checkout db."); |
| 639 | } |
| 640 | zUuid = next_token(&x, &sz); |
| 641 | if( p->zBaseline==0 || zUuid!=0 ){ |
| 642 | if( zUuid==0 ) SYNTAX("missing hash on F-card"); |
| 643 | if( !hname_validate(zUuid,sz) ){ |
| 644 | SYNTAX("F-card hash invalid"); |
| 645 | } |
| 646 | } |
| 647 | zPerm = next_token(&x,0); |
| 648 |