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

utils.hpp length check #44

Open
RPGillespie6 opened this issue Jan 9, 2024 · 0 comments
Open

utils.hpp length check #44

RPGillespie6 opened this issue Jan 9, 2024 · 0 comments

Comments

@RPGillespie6
Copy link

utils.hpp contains the following length check for is_compressed:

return size > 2 && ...

However, it only uses the first two bytes. I would vote that length check should be return size >= 2 && ...

This would allow me to do something like:

        char gzipHeader[2];
        file.read(gzipHeader, 2);
        file.seekg(0, ios::beg); // rewind

        if (gzip::is_compressed(gzipHeader, 2))
            // do something...
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