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

tinfl_decompress_mem_to_heap fails to decompress any input due to early exit in tinfl_decompress #276

Open
phildremi opened this issue Jun 13, 2023 · 0 comments

Comments

@phildremi
Copy link

In fe6330e, @jpcha2 added an early exit to tinfl_decompress. Unfortunately, this broke tinfl_decompress_mem_to_heap:

  • When tinfl_decompress_mem_to_heap is first called, the output buffer is not yet allocated (NULL)
  • tinfl_decompress receives this value and now exits early with error code TINFL_STATUS_BAD_PARAM
  • This causes tinfl_decompress_mem_to_heap to return NULL as well, without any decompression having taken place
  • Before the change, this line would have been reached to allocate an output buffer of 128 bytes instead

If you run the miniz_tester app before/after the change, you should be able to see it fail in simple_test1.

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

No branches or pull requests

1 participant