Skip to content

zlib incorrect data check error #48017

Closed
Closed

Description

@MuhammedKalkan

Version

v16.16.0

Platform

Microsoft Windows NT 10.0.22621.0 x64

Subsystem

No response

What steps will reproduce the bug?

When a particular buffer zipped over the variable itself. Data becomes corrupted. Possible to occur up to version 20. Need checking
If it is zipped to a new variable , everything works as expected

buffer.json = 'https://www.dropbox.com/s/g7jh19o0cmn9kp3/buffer.json?dl=0';

let buffer = Buffer.from(buffer.json) //Pseudo code here. Parse it however you like
buffer = zlib.gzipSync(buffer); 
zlib.unzipSync(buffer) //Error: incorrect data check

How often does it reproduce? Is there a required condition?

Always. Consistent

What is the expected behavior? Why is that the expected behavior?

Expect to unzip without error

What do you see instead?

Error: incorrect data check

Additional information

Need to check newer versions of node and zlib.

Activity

  1. jimmywarting commented on May 15, 2023

    @jimmywarting
  2. MuhammedKalkan commented on May 15, 2023

    @MuhammedKalkan
    Author

    Maybe i should add , if it is zipped to a new variable , everything works as expected

  3. jimmywarting commented on May 15, 2023

    @jimmywarting

    try with this option:

    const zlibOptions = {
      flush: zlib.Z_SYNC_FLUSH,
      finishFlush: zlib.Z_SYNC_FLUSH
    }
  4. added
    zlibIssues and PRs related to the zlib module and its compression dependencies.
    on May 15, 2023
  5. MuhammedKalkan commented on May 15, 2023

    @MuhammedKalkan
    Author

    I want to read whole data by the way. Documentation says only part could be read with that options?
    I use it to de/compress an important data.

  6. jimmywarting commented on May 15, 2023

    @jimmywarting

    using this will only say that you ignore the integrity checks at the end of the stream / buffer to make sure that the data you got out was the expected end result

  7. MuhammedKalkan commented on May 16, 2023

    @MuhammedKalkan
    Author

    Tried but no luck. Strange part is , i have zipped twice totally same data. . However one of them fails to unzip and other one succeeds. When inspected byte by byte as a buffer errored one writes a byte value as 210 instead 218 in the middle of the buffer (11040 or so of total 24000 bytes)

    Just try this file : https://www.dropbox.com/s/p1zvp64x5kjell1/test?dl=0

  8. MuhammedKalkan commented on May 17, 2023

    @MuhammedKalkan
    Author

    Closing this one, might be os or memory error

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

    zlibIssues and PRs related to the zlib module and its compression dependencies.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions