-
Notifications
You must be signed in to change notification settings - Fork 97
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
opt: add debug log and more friendly error message #2039
base: staged
Are you sure you want to change the base?
Conversation
@@ -108,8 +106,10 @@ bool IndexedZip::loadFile( uint32_t offset, vector< char > & data ) | |||
return false; | |||
} | |||
|
|||
if ( inflate( &stream, Z_FINISH ) != Z_STREAM_END ) { | |||
qDebug( "Not zstream end!" ); | |||
int ret = inflate( &stream, Z_FINISH ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a few lines below, the infalteEnd
doesn't check inflateEnd( &stream) != Z_OK
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is neccessary to check the inflateEnd result?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the source code, it is some sanity checks, one of them appears to be checking z_stream_s->state
.
I am not 100% certain if it is needed because inflate
could return Z_STREAM_ERROR
and various other errors.
I think we should check it religiously to make sure all errors are handled.
https://github.com/madler/zlib/blob/ef24c4c7502169f016dcd2a26923dbaf3216748c/inflate.c#L94-L104
Quality Gate failedFailed conditions See analysis details on SonarQube Cloud Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE |
No description provided.