We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
static analysis with cppcheck found this
miniz.c:2468:19: warning: Uninitialized variable: r->m_num_bits [uninitvar] num_bits = r->m_num_bits; ^ miniz.c:2965:31: note: Calling function 'tinfl_decompress', 1st argument '&decomp' value is <Uninit> status = tinfl_decompress(&decomp, (const mz_uint8 *)pSrc_buf, &src_buf_len, (mz_uint8 *)pOut_buf, (mz_uint8 *)pOut_buf, &out_buf_len, (flags & ~TINFL_FLAG_HAS_MORE_INPUT) | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF); ^ miniz.c:2455:55: note: Assuming condition is Assuming condition is false if (((out_buf_size_mask + 1) & out_buf_size_mask) || (pOut_buf_next < pOut_buf_start)) ^ miniz.c:2468:19: note: Uninitialized variable: r->m_num_bits num_bits = r->m_num_bits;
Adding the uninit fields to tinfl_init fixes it.
--- miniz_tinfl.h +++ miniz_tinfl.h @@ -92,7 +92,7 @@ typedef enum { do \ { \ - (r)->m_state = 0; \ + memset(r, 0, sizeof (tinfl_decompressor)); \ } \ MZ_MACRO_END #define tinfl_get_adler32(r) (r)->m_check_adler32
The text was updated successfully, but these errors were encountered:
Fix uninitialized tinfl_init()
4589c32
Fixes GH richgel999#296. Found by cppcheck
No branches or pull requests
static analysis with cppcheck found this
Adding the uninit fields to tinfl_init fixes it.
The text was updated successfully, but these errors were encountered: