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

src: fix slice of slice of file-backed Blob #53972

Merged
merged 1 commit into from
Jul 22, 2024

Commits on Jul 20, 2024

  1. src: fix slice of slice of file-backed Blob

    The value for `new_end` was wrong: While the members `start_` and `end_`
    refer to the entire length of the file, the parameters `start` and `end`
    are relative to the current slice.
    
    The new end would apparently have the current start_ subtracted from it,
    and the length would possibly overflow when the FdEntry is asked for its
    size or when get_reader is called, resulting in a subslice which extends
    past the current slice, which shouldn't be possible. Add a CHECK if this
    happens, rather than returning data outside the current slice.
    
    There aren't any C++ tests for FdEntry, and on the javascript side there
    isn't a way to ask the blob handle for its nominal size. That size could
    be a large uint64, which gets converted to int64 to when FileHandle::new
    is called, which interprets a negative length as unlimited.
    
    Fixes: nodejs#53908
    jleedev committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    a387ccd View commit details
    Browse the repository at this point in the history