Closed advantech-edgelink closed 1 year ago
static int initiate_socket_connection(SOCKET_IO_INSTANCE* socket_io_instance) { int result; int flags; struct addrinfo* addr = NULL; struct sockaddr_un addrInfoUn; if(socket_io_instance->address_type == ADDRESS_TYPE_IP) { ... } else { ... } if (socket_io_instance->address_type == ADDRESS_TYPE_IP) { socket_io_instance->socket = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol); } else { socket_io_instance->socket = socket(AF_UNIX, SOCK_STREAM, 0); } ... }
The addr may be NULL when executing socket_io_instance->socket = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol);
addr
socket_io_instance->socket = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol);
Thanks for reporting, @advantech-edgelink ! A PR with the fix will come briefly.
Hi @advantech-edgelink, we've merged the PR with the fix, thank you again for reporting! Closing the issue now.
The
addr
may be NULL when executingsocket_io_instance->socket = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol);