Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

Fix potential crash in HdbConfigurationManager::add_domain (#6) #9

Merged
merged 1 commit into from
Jun 25, 2020

Conversation

bourtemb
Copy link
Member

Fix crash when getaddrinfo is returning several struct addrinfo
The second struct addrinfo contains a field ai-canonname which is NULL.
This caused a crash because some code was attempting to create a string from a null pointer.

getaddrinfo man page (on Debian Buster) says the following:

If hints.ai_flags includes the AI_CANONNAME flag, then the ai_canon-
name field of the first of the addrinfo structures in the returned
list is set to point to the official name of the host.

So there is no need to look at the following addrinfo returned structures.

…trols-hdbpp#6)

Fix crash when getaddrinfo is returning several struct addrinfo
The second struct addrinfo contains a field ai-canonname which is NULL.
This caused a crash because some code was attempting to create a string from a null pointer.

getaddrinfo man page (on Debian Buster) says the following:

If hints.ai_flags includes the AI_CANONNAME flag, then the ai_canon-
name field of the first of the addrinfo structures in the returned
list is set to point to the official name of the host.

So there is no need to look at the following addrinfo returned structures.
@bourtemb bourtemb requested a review from gscalam January 15, 2020 14:22
@dlacoste-esrf dlacoste-esrf merged commit 26dbac2 into tango-controls-hdbpp:master Jun 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants