Skip to content

Fix: sizeof(sizeof(addr.saX)) -> sizeof(addr.saX) in readaddrinfo#331

Merged
bradh352 merged 1 commit intoc-ares:masterfrom
basiliscos:fix-double-sizeof
May 12, 2020
Merged

Fix: sizeof(sizeof(addr.saX)) -> sizeof(addr.saX) in readaddrinfo#331
bradh352 merged 1 commit intoc-ares:masterfrom
basiliscos:fix-double-sizeof

Conversation

@basiliscos
Copy link
Copy Markdown
Contributor

Currently it always returns 8 bytes (x64 architecture), so bind memcpy(dest, ai->ai_addr, ai->ai_addrlen) is buggy, and instead of relying on ai_addrlen field, ai_addr should be examined for type before copying; the last approach is a workaround, of course.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 89.14% when pulling ebc1370 on basiliscos:fix-double-sizeof into 1cc7e83 on c-ares:master.

@bradh352 bradh352 merged commit 4c02944 into c-ares:master May 12, 2020
@basiliscos basiliscos deleted the fix-double-sizeof branch May 12, 2020 11:38
sergepetrenko pushed a commit to tarantool/c-ares that referenced this pull request Jul 29, 2022
…ares#331)

Looks like a sed-gone-wrong, a sizeof inside of a sizeof.

Fix By: Ivan Baidakou (@basiliscos)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants