Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CHECK] Do not continue with other checks if integrity check fails. #413

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

mgautierfr
Copy link
Collaborator

It make no sense to check content in a zim archive if the zim archive itself is broken and we can't read it.

Fix openzim/libzim#893

src/zimcheck/zimcheck.cpp Outdated Show resolved Hide resolved
@mgautierfr mgautierfr force-pushed the no_crash_on_corrupted branch 2 times, most recently from 7d7c551 to 6dad932 Compare June 13, 2024 15:28
Copy link

codecov bot commented Jun 13, 2024

Codecov Report

Attention: Patch coverage is 11.53846% with 23 lines in your changes missing coverage. Please review.

Project coverage is 27.02%. Comparing base (d6c6a1b) to head (875e09a).

Files Patch % Lines
src/zimcheck/zimcheck.cpp 4.16% 0 Missing and 23 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #413      +/-   ##
==========================================
+ Coverage   26.98%   27.02%   +0.03%     
==========================================
  Files          26       26              
  Lines        2453     2457       +4     
  Branches     1338     1340       +2     
==========================================
+ Hits          662      664       +2     
  Misses       1304     1304              
- Partials      487      489       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@veloman-yunkan veloman-yunkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is technically an approval. Please fix the message before merging.

if(enabled_tests.isEnabled(TestType::INTEGRITY)) {
should_run_full_test = test_integrity(filename, error);
} else {
error.infoMsg("[WARNING] Integrity check is skipped. Any detected errors may in fact due to corrupted/invalid data.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... in fact be due to ...

It make no sense to check content in a zim archive if the zim archive
itself is broken and we can't read it.
@mgautierfr
Copy link
Collaborator Author

Fixed. Directly merge if you agree.

@veloman-yunkan veloman-yunkan merged commit 1b2e64c into main Jun 14, 2024
10 of 12 checks passed
@veloman-yunkan veloman-yunkan deleted the no_crash_on_corrupted branch June 14, 2024 14:42
@kelson42 kelson42 added this to the 3.5.0 milestone Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New crash scenario of the libzim with corrupted ZIM file
3 participants