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

Fail gracefully in case of unsupported extended file attributes #2130

Merged
merged 1 commit into from
Nov 23, 2023

Commits on Nov 22, 2023

  1. If extended attributes are not supported xattr->Get() returns

    -ENOTSUP. When this small negative value is cast to a size_t in the
    call to new on the following line it becomes a very large integer and
    the request to allocate this enormous memory block fails with a
    std::bad_alloc exception.
    
    This commit adds a check on the returned size and returns an error if
    it is negative avoiding triggering the std::bad_alloc exception.
    ellert committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    6b01c51 View commit details
    Browse the repository at this point in the history