FFFF Using mz_stream_open() on buffered stream causes infinite recursion · Issue #216 · zlib-ng/minizip-ng · GitHub
[go: up one dir, main page]

Skip to content

Using mz_stream_open() on buffered stream causes infinite recursion #216

Closed

Description

@chenxiaolong

Using mz_stream_open() on a buffered stream seems to cause minizip to get stuck in infinite recursion.
For example, if I run this sample program: https://gist.github.com/chenxiaolong/dbab3fbef51b9d0fa969e220dbb85967, it hangs indefinitely and the stack trace shows:

[build] pstack $(pidof a.out)
#0  mz_stream_open (stream=0x16f4290, path=0x7ffc1a039e70 "/tmp/foobar.zip", mode=1) at /stuff/Android/DualBootPatcher/minizip.cxl/src/mz_strm.c:26
#1  0x000000000040134f in main (argc=2, argv=0x7ffc1a0396d8) at test.c:66

I haven't looked too deeply into the code, but should these two functions be referring to the base stream instead of the buf stream?

https://github.com/nmoinvaz/minizip/blob/13a12e32abca2af5523b403ff8878277912c20d6/src/mz_strm_buf.c#L67-L77

Activity

  1. added a commit that references this issue on Jan 2, 2018
  2. nmoinvaz commented on Jan 2, 2018

    @nmoinvaz
    Member

    Yes you are right it should have been referencing the base stream. I have made some changes and added buffering into the test app. Let me know if you have any more issues.

  3. chenxiaolong commented on Jan 2, 2018

    @chenxiaolong
    Author

    Thank you! I'll give it a try after work today.

  4. chenxiaolong commented on Jan 3, 2018

    @chenxiaolong
    Author

    This seems to be working fine now. Thanks for fixing it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixedIssue or bug has been fixed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0