Fossil SCM

Fix crash in the 'zip', 'tarball' and 'sqlar' commands when a manifest entry for a file has no hash (e.g. after a deletion). Reported off-list by Dan Mestas.

danield 2026-10-14 14:08 UTC trunk
Commit 4886b7de6d9c5a9df730de3efd84b938b4118b6a7159a3e821dd767185e7bde7
2 files changed +1 +1
+1
--- src/tar.c
+++ src/tar.c
@@ -613,10 +613,11 @@
613613
manifest_file_rewind(pManifest);
614614
while( (pFile = manifest_file_next(pManifest,0))!=0 ){
615615
int fid;
616616
if( pInclude!=0 && !glob_match(pInclude, pFile->zName) ) continue;
617617
if( glob_match(pExclude, pFile->zName) ) continue;
618
+ if( pFile->zUuid==0 ) continue;
618619
fid = uuid_to_rid(pFile->zUuid, 0);
619620
if( fid ){
620621
blob_resize(&filename, nPrefix);
621622
blob_append(&filename, pFile->zName, -1);
622623
zName = blob_str(&filename);
623624
--- src/tar.c
+++ src/tar.c
@@ -613,10 +613,11 @@
613 manifest_file_rewind(pManifest);
614 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
615 int fid;
616 if( pInclude!=0 && !glob_match(pInclude, pFile->zName) ) continue;
617 if( glob_match(pExclude, pFile->zName) ) continue;
 
618 fid = uuid_to_rid(pFile->zUuid, 0);
619 if( fid ){
620 blob_resize(&filename, nPrefix);
621 blob_append(&filename, pFile->zName, -1);
622 zName = blob_str(&filename);
623
--- src/tar.c
+++ src/tar.c
@@ -613,10 +613,11 @@
613 manifest_file_rewind(pManifest);
614 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
615 int fid;
616 if( pInclude!=0 && !glob_match(pInclude, pFile->zName) ) continue;
617 if( glob_match(pExclude, pFile->zName) ) continue;
618 if( pFile->zUuid==0 ) continue;
619 fid = uuid_to_rid(pFile->zUuid, 0);
620 if( fid ){
621 blob_resize(&filename, nPrefix);
622 blob_append(&filename, pFile->zName, -1);
623 zName = blob_str(&filename);
624
+1
--- src/zip.c
+++ src/zip.c
@@ -806,10 +806,11 @@
806806
if( pZip ) zip_add_file(&sArchive, "", 0, 0);
807807
while( (pFile = manifest_file_next(pManifest,0))!=0 ){
808808
int fid;
809809
if( pInclude!=0 && !glob_match(pInclude, pFile->zName) ) continue;
810810
if( glob_match(pExclude, pFile->zName) ) continue;
811
+ if( pFile->zUuid==0 ) continue;
811812
fid = uuid_to_rid(pFile->zUuid, 0);
812813
if( fid ){
813814
blob_resize(&filename, nPrefix);
814815
blob_append(&filename, pFile->zName, -1);
815816
zName = blob_str(&filename);
816817
--- src/zip.c
+++ src/zip.c
@@ -806,10 +806,11 @@
806 if( pZip ) zip_add_file(&sArchive, "", 0, 0);
807 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
808 int fid;
809 if( pInclude!=0 && !glob_match(pInclude, pFile->zName) ) continue;
810 if( glob_match(pExclude, pFile->zName) ) continue;
 
811 fid = uuid_to_rid(pFile->zUuid, 0);
812 if( fid ){
813 blob_resize(&filename, nPrefix);
814 blob_append(&filename, pFile->zName, -1);
815 zName = blob_str(&filename);
816
--- src/zip.c
+++ src/zip.c
@@ -806,10 +806,11 @@
806 if( pZip ) zip_add_file(&sArchive, "", 0, 0);
807 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
808 int fid;
809 if( pInclude!=0 && !glob_match(pInclude, pFile->zName) ) continue;
810 if( glob_match(pExclude, pFile->zName) ) continue;
811 if( pFile->zUuid==0 ) continue;
812 fid = uuid_to_rid(pFile->zUuid, 0);
813 if( fid ){
814 blob_resize(&filename, nPrefix);
815 blob_append(&filename, pFile->zName, -1);
816 zName = blob_str(&filename);
817

Keyboard Shortcuts

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