Skip to content

multi: avoid reading whole struct pointer from pointer - #15063

Closed
bagder wants to merge 1 commit into
masterfrom
bagder/trhash
Closed

multi: avoid reading whole struct pointer from pointer#15063
bagder wants to merge 1 commit into
masterfrom
bagder/trhash

Conversation

@bagder

@bagder bagder commented Sep 26, 2024

Copy link
Copy Markdown
Member

The proper alignment is not guaranteed. This now uses only the first and last byte in the key since they are the ones likely to change most (one of them, depending on CPU endian) and the hash is tiny anyway.

The proper alignment is not guaranteed. This now uses only the first and
last byte in the key since they are the ones likely to change most (one
of them, depending on CPU endian) and the hash is tiny anyway.
@bagder bagder added the tidy-up label Sep 26, 2024
@bagder bagder changed the title multi: avoid reading whole struct from pointer multi: avoid reading whole struct pointer from pointer Sep 26, 2024
@dfandrich

Copy link
Copy Markdown
Contributor

Analysis of PR #15063 at 7afd6417:

Test 2405 failed, which has NOT been flaky recently, so there could be a real issue in the PR.

Test 1035 failed, which has NOT been flaky recently, so there could be a real issue in the PR.

Generated by Testclutch

@bagder bagder closed this in d08d16c Sep 26, 2024
@bagder
bagder deleted the bagder/trhash branch September 26, 2024 21:38
@jay

jay commented Sep 26, 2024

Copy link
Copy Markdown
Member

if the keylen is greater than the size of a Curl_easy then wouldn't it be out of bounds?

@bagder

bagder commented Sep 26, 2024

Copy link
Copy Markdown
Member Author

They keys are struct Curl_easy * in this hash, so the keylen will be the size of the pointer.

pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
The proper alignment is not guaranteed. This function now instead uses
only the first and last byte of the key since they are the ones likely
to change most (one of them, depending on CPU endian) and the hash is
tiny anyway.

Closes curl#15063
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants