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

decompress function is stucked when i pass the buffer array into it #99

Open
TkachenkoDaniil opened this issue Jun 2, 2022 · 0 comments

Comments

@TkachenkoDaniil
Copy link

I've got a problem with decompression library. I use it for unarchive file. I haven't had problems with it before but recently i've got a bug.
I get this archive as base64 string, then a transform it into Buffer and finally pass this Buffer into decompression function and it's just stucked. There are no info or error messages, my server is stucked too. I guess there must be infinity loop or something like this.

Error Result:

const value = 'UEsDBBQACAAIAONFuVQAAAAAAAAAAAAAAAAWAAAAZmlsZV9kZXRlY3RfYnlfTUQ1LmlvY4VSwY7bIBS8V+o/IO4EjMFAZGdVdVVppaaX7qG3iIWXDWqMI0Oa9O9LnGyyaQ+9WPjNm3lvBtqHY79Fv2BMYYgdrmYMI4hu8CG+dnifiE0uBPyw+PihDYNDpTum+TGFDm9y3s0pPRwOs0M9G8ZXyhmr6I/l1+9uA70lIaZsowN8Zfn/szAKpUtLZRsnKqIEByI0M8RC0xAttQbOrJemwWhrUyZ92XUdoJA44xVhNWHyuVJzrueMXUZfx6ZpRpr1NvpgY565oS8LVIwWc7iYRKhNm2HMKw/JjWGXSyyLL2ELq+WjbOm/2ESx+1wA8CtvMyz+2qOZi6al9y0Taxviz4To+cfDOsRwlSyVp7Kis3kY0bCD8XTo8Kdvj+eAxAuohnNDfG0NEVZZYurKlw8w2bi1WCuDL0rvtZ4y9JMAr+rSWluinJBEKKuIFlYSy2sD2r/UTiiM3FCIeXoaId30iuLnIWY4ZuQHt+8h5g6fUjrJY5TAjm5zq9Cll2lfgPx7Bx3uw4gvtt+LxfyGe4kXojHagjFKKvB1pYxmunKyBs29WAvb0gvpZpLeuXyL8VY9B03vkm5PF7/4A1BLBwgAAAAAuQEAAAAAAABQSwECLQMUAAgACADjRblUAAAAALkBAAAAAAAAFgAAAAAAAAAAACAApIEAAAAAZmlsZV9kZXRlY3RfYnlfTUQ1LmlvY1BLBQYAAAAAAQABAEQAAAD9AQAAAAA='

const buffered = Buffer.from(value, "base64");
const data = await decompress(buffered); // my program stuck here

it's a proof that my base64 right - https://gchq.github.io/CyberChef/#recipe=From_Base64('A-Za-z0-9%2B/%3D',true)Unzip('',false)&input=VUVzREJCUUFDQUFJQU9ORnVWUUFBQUFBQUFBQUFBQUFBQUFXQUFBQVptbHNaVjlrWlhSbFkzUmZZbmxmVFVRMUxtbHZZNFZTd1k3YklCUzhWK28vSU80RWpNRkFaR2RWZFZWcHBhYVg3cUczaUlXWERXcU1JME9hOU85TG5HeXlhUSs5V1BqTm0zbHZCdHFIWTc5RnYyQk1ZWWdkcm1ZTUk0aHU4Q0crZG5pZmlFMHVCUHl3K1BpaERZTkRwVHVtK1RHRkRtOXkzczBwUFJ3T3MwTTlHOFpYeWhtcjZJL2wxKzl1QTcwbElhWnNvd044WmZuL3N6QUtwVXRMWlJzbktxSUVCeUkwTThSQzB4QXR0UWJPckplbXdXaHJVeVo5MlhVZG9KQTQ0eFZoTldIeXVWSnpydWVNWFVaZng2WnBScHIxTnZwZ1k1NjVvUzhMVkl3V2M3aVlSS2hObTJITUt3L0pqV0dYU3l5TEwyRUxxK1dqYk9tLzJFU3grMXdBOEN0dk15eisycU9aaTZhbDl5MFRheHZpejRUbytjZkRPc1J3bFN5VnA3S2lzM2tZMGJDRDhYVG84S2R2aitlQXhBdW9obk5EZkcwTkVWWlpZdXJLbHc4dzJiaTFXQ3VETDBydnRaNHk5Sk1BcityU1dsdWluSkJFS0t1SUZsWVN5MnNEMnIvVVRpaU0zRkNJZVhvYUlkMzBpdUxuSVdZNFp1UUh0KzhoNWc2ZlVqckpZNVRBam01enE5Q2xsMmxmZ1B4N0J4M3V3NGd2dHQrTHhmeUdlNGtYb2pIYWdqRktLdkIxcFl4bXVuS3lCczI5V0F2YjBndnBacExldVh5TDhWWTlCMDN2a201UEY3LzRBMUJMQndnQUFBQUF1UUVBQUFBQUFBQlFTd0VDTFFNVUFBZ0FDQURqUmJsVUFBQUFBTGtCQUFBQUFBQUFGZ0FBQUFBQUFBQUFBQ0FBcElFQUFBQUFabWxzWlY5a1pYUmxZM1JmWW5sZlRVUTFMbWx2WTFCTEJRWUFBQUFBQVFBQkFFUUFBQUQ5QVFBQUFBQT0

Access result:

const value2 = 'UEsDBBQACAAIADJtwlQAAAAAAAAAAAAAAAAWAAAAZmlsZV9kZXRlY3RfYnlfTUQ1LmlvY4VSwY7bIBS8V+o/IO4EjMFAZGdVdVVppaaX7qG3iIWXDWqMI0Oa9O9LnGyyaQ+9WPjNm3lvBtqHY79Fv2BMYYgdrmYMI4hu8CG+dnifiE0uBPyw+PihDYNDpTum+TGFDm9y3s0pPRwOs0M9G8ZXyhmr6I/l1+9uA70lIaZsowN8Zfn/szAKpUtLZRsnKqIEByI0M8RC0xAttQbOrJemwWhrUyZ92XUdoJA44xVhNWHyuVJzrueMXUZfx6ZpRpr1NvpgY565oS8LVIwWc7iYRKhNm2HMKw/JjWGXSyyLL2ELq+WjbOm/2ESx+1wA8CtvMyz+2qOZi6al9y0Taxviz4To+cfDOsRwlSyVp7Kis3kY0bCD8XTo8Kdvj+eAxAuohnNDfG0NEVZZYurKlw8w2bi1WCuDL0rvtZ4y9JMAr+rSWluinJBEKKuIFlYSy2sD2r/UTiiM3FCIeXoaId30iuLnIWY4ZuQHt+8h5g6fUjrJY5TAjm5zq9Cll2lfgPx7Bx3uw4gvtt+LxfyGe4kXojHagjFKKvB1pYxmunKyBs29WAvb0gvpZpLeuXyL8VY9B03vkm5PF7/4A1BLBwhca76XuQEAAAYDAABQSwECLQMUAAgACAAybcJUXGu+l7kBAAAGAwAAFgAAAAAAAAAAACAApIEAAAAAZmlsZV9kZXRlY3RfYnlfTUQ1LmlvY1BLBQYAAAAAAQABAEQAAAD9AQAAAAA='

const buffered = Buffer.from(value2, "base64");
const data = await decompress(buffered); // using value2 i got right object with data

decompressing with value2 - https://gch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RVUTFMbWx2WTFCTEJRWUFBQUFBQVFBQkFFUUFBQUQ5QVFBQUFBQT0

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