You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In connector.go, line 264, a call to BuildRequest is made, but err is never checked before req is passed to SendRequest on line 265. In the event BuildRequest fails, which is possible if the Connector's HostConfig object has an invalid Host attribute (for example, if it's accidentally specified as a URL rather than an IP/hostname) then req is nil.
When this is passed to SendRequest, it is blindly passed to the Do method of net/http.Client which then segfaults.
There should probably be some error checking here to fail more gracefully and/or some validation of the contents of HostConfig in Init on line 174
The text was updated successfully, but these errors were encountered:
Totally agree that there should be a check for error returned by BuildRequest before calling SendRequesthere.
The above won't address the example case of an invalid Host attribute. As you suggested, this can be addressed by validating HostConfig in Init. In addition, I noticed that there's a call to ValidateConnectorhere that is supposed to perform a validation by actually making a connection. However, the implementation has been commented out (see https://github.com/infobloxopen/infoblox-go-client/blob/master/connector.go#L378-L384). Perhaps we can resurrect that?
In connector.go, line 264, a call to
BuildRequest
is made, buterr
is never checked beforereq
is passed toSendRequest
on line 265. In the eventBuildRequest
fails, which is possible if theConnector
'sHostConfig
object has an invalidHost
attribute (for example, if it's accidentally specified as a URL rather than an IP/hostname) thenreq
isnil
.When this is passed to
SendRequest
, it is blindly passed to theDo
method ofnet/http.Client
which then segfaults.There should probably be some error checking here to fail more gracefully and/or some validation of the contents of
HostConfig
inInit
on line 174The text was updated successfully, but these errors were encountered: