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

Reader fails with out of bounds pointer error when reading from compressed stream #468

Open
alex-maiorov opened this issue Dec 26, 2023 · 1 comment

Comments

@alex-maiorov
Copy link

alex-maiorov commented Dec 26, 2023

Hello,

I have been using this library for a project and ran into a potential issue, and I am unsure if this is a problem with the library or with my code. Originally, I had code along the lines of this:

let mut gzreader = flate2::read::GzDecoder::new(gz_file);
let message_reader = serialize::read_message(
        &mut BufReader::new(gzreader),
        capnp_reader_options,
).unwrap();
let root_message = message_reader.get_root::<my_schema_capnp::message_type::Reader>().unwrap();

And it would always fail with MessageContainsOutOfBoundsPointer. However, when I replaced &mut BufReader::new(gzreader) with &uncompressed_data[..], where uncompressed_data was simply the fully uncompresed data, it would work. This solution works but is not ideal considering that my uncompressed data can be gigabytes in size.

@dwrensha
Copy link
Member

Can you provide a self-contained example that reproduces the problem?

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

2 participants