-
Notifications
You must be signed in to change notification settings - Fork 861
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Have sock_initaddress() return the list of addrinfo structures or NULL.
Its return address is currently 0 for success and -1 for failure, with a pointer to the first element of the list of struct addrinfos returned through a pointer on success; change it to return that pointer on success and NULL on failure. That way, we don't have to worry about what happens to the pointer pointeed to by the argument in question on failure; we know that we got NULL back if no struct addrinfos were found because getaddrinfo() failed. Thus, we know that we have something to free iff sock_initaddress() returned a pointer to that something rather than returning NULL. This avoids a double-free in some cases. This is apparently CVE-2023-40400. (backported from commit 262e4f3)
- Loading branch information
Showing
5 changed files
with
72 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters