Skip to content

Conversation

@BenchBeach
Copy link

Hello team,

This PR improves the robustness of the uncompress2 function by adding defensive parameter validation.

Currently, passing NULL for essential pointers like sourceLen or destLen will cause a segmentation fault. This change prevents this crash by adding checks at the beginning of the function.

If any parameter is invalid, the function now returns Z_STREAM_ERROR, providing the caller with a clear and actionable error instead of a crash. This behavior is consistent with the library's conventions for handling invalid arguments.

I believe this makes the function safer and easier to debug for developers. Happy to address any feedback.

Thank you for your time and consideration.

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.

1 participant