Skip to content

Conversation

vszakats
Copy link
Member

@vszakats vszakats commented Mar 28, 2024

  • If the length of a response is UINT_MAX - 3 or larger, an unsigned
    integer overflow occurs on 64-bit systems. Avoid such truncation to
    always allocate enough memory to avoid subsequent out of boundary
    writes.

    Patch-by: Tobias Stoeckmann

  • also add FIXME to bump up length field to size_t (ABI break)

Closes #1337

@vszakats
Copy link
Member Author

/cc @stoeckmann

vszakats added a commit to vszakats/libssh2 that referenced this pull request Mar 28, 2024
  integer overflow occurs on 64-bit systems. Avoid such truncation to
  always allocate enough memory to avoid subsequent out of boundary
  writes.

  Patch-by: Tobias Stoeckmann

- also add FIXME to bump up length field to `size_t` (ABI break)

Closes libssh2#1337
- If the length of a response is `UINT_MAX - 3` or larger, an unsigned
  integer overflow occurs on 64-bit systems. Avoid such truncation to
  always allocate enough memory to avoid subsequent out of boundary
  writes.

  Patch-by: Tobias Stoeckmann

- also add FIXME to bump up length field to `size_t` (ABI break)

Closes libssh2#1337
@vszakats vszakats closed this in a6a9093 Mar 29, 2024
@vszakats vszakats deleted the overflow branch March 29, 2024 09:16
agreppin pushed a commit to agreppin/libssh2 that referenced this pull request Jul 14, 2024
- If the length of a response is `UINT_MAX - 3` or larger, an unsigned
  integer overflow occurs on 64-bit systems. Avoid such truncation to
  always allocate enough memory to avoid subsequent out of boundary
  writes.

  Patch-by: Tobias Stoeckmann

- also add FIXME to bump up length field to `size_t` (ABI break)

Closes libssh2#1337
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant