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.
Commit
4886b7de6d9c5a9df730de3efd84b938b4118b6a7159a3e821dd767185e7bde7
Parent
afe648437872b03…
2 files changed
+1
+1
+1
| --- src/tar.c | ||
| +++ src/tar.c | ||
| @@ -613,10 +613,11 @@ | ||
| 613 | 613 | manifest_file_rewind(pManifest); |
| 614 | 614 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 615 | 615 | int fid; |
| 616 | 616 | if( pInclude!=0 && !glob_match(pInclude, pFile->zName) ) continue; |
| 617 | 617 | if( glob_match(pExclude, pFile->zName) ) continue; |
| 618 | + if( pFile->zUuid==0 ) continue; | |
| 618 | 619 | fid = uuid_to_rid(pFile->zUuid, 0); |
| 619 | 620 | if( fid ){ |
| 620 | 621 | blob_resize(&filename, nPrefix); |
| 621 | 622 | blob_append(&filename, pFile->zName, -1); |
| 622 | 623 | zName = blob_str(&filename); |
| 623 | 624 |
| --- 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 @@ | ||
| 806 | 806 | if( pZip ) zip_add_file(&sArchive, "", 0, 0); |
| 807 | 807 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 808 | 808 | int fid; |
| 809 | 809 | if( pInclude!=0 && !glob_match(pInclude, pFile->zName) ) continue; |
| 810 | 810 | if( glob_match(pExclude, pFile->zName) ) continue; |
| 811 | + if( pFile->zUuid==0 ) continue; | |
| 811 | 812 | fid = uuid_to_rid(pFile->zUuid, 0); |
| 812 | 813 | if( fid ){ |
| 813 | 814 | blob_resize(&filename, nPrefix); |
| 814 | 815 | blob_append(&filename, pFile->zName, -1); |
| 815 | 816 | zName = blob_str(&filename); |
| 816 | 817 |
| --- 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 |