Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jaeger::TUDPTransport::write crash when getaddrinfo returns error #1116

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions exporters/jaeger/src/TUDPTransport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ void TUDPTransport::close()

uint32_t TUDPTransport::read(uint8_t *buf, uint32_t len)
{
if (!server_addr_info_)
ThomsonTan marked this conversation as resolved.
Show resolved Hide resolved
{
return 0;
}
uint32_t num_read = recvfrom(socket_,
#if defined(_WIN32)
reinterpret_cast<char *>(buf), len, 0, server_addr_info_->ai_addr,
Expand All @@ -89,6 +93,10 @@ uint32_t TUDPTransport::read(uint8_t *buf, uint32_t len)

void TUDPTransport::write(const uint8_t *buf, uint32_t len)
{
if (!server_addr_info_)
{
return;
}
sendto(socket_,
#if defined(_WIN32)
reinterpret_cast<const char *>(buf),
Expand Down