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

Fix crashes/freezes in VSS stripping code #913

Merged
merged 2 commits into from
Apr 14, 2023
Merged

Fix crashes/freezes in VSS stripping code #913

merged 2 commits into from
Apr 14, 2023

Commits on Apr 5, 2023

  1. Fix VSS stripping behavior when headers span >1 network block.

    When VSS header data straddles multiple network blocks (i.e. got <
    bsidsize in bfile_write_vss_strip()), the pointer arithmatic when
    memcpy()ing the next block is incorrect.
    
    Since sid is a pointer to a structure, each addition by 1 increases
    the pointer address by sizeof(*sid); therefore, when sidlen > 0, the
    memcpy() unintentionally overwrites part of the struct BFILE it lives
    within or the memory situated after it.
    
    Casting sid to a char* in the memcpy() causes the addition to advance
    the pointer by single bytes as intended.
    raineth committed Apr 5, 2023
    Configuration menu
    Copy the full SHA
    8b979f1 View commit details
    Browse the repository at this point in the history
  2. Don't hang when stripping VSS data from files with an empty stream.

    When stripping VSS data, an empty stream that has additional data
    following it will currently cause an infinite loop in
    bfile_write_vss_strip().
    
    When encountering an empty stream, attempt to start reading a new VSS
    header instead.
    raineth committed Apr 5, 2023
    Configuration menu
    Copy the full SHA
    fdea3a0 View commit details
    Browse the repository at this point in the history