Skip to content
Permalink
Browse files

DgramSocket, bugfix: crash when calling the send method of an unbound…

… socket.
  • Loading branch information...
xicilion committed Feb 4, 2019
1 parent 5eec5d6 commit e4b8a26b290d26b15194c9a00be31d77ec4ed818
Showing with 3 additions and 4 deletions.
  1. +3 −4 fibjs/src/net/DgramSocket.cpp
@@ -276,17 +276,16 @@ result_t DgramSocket::send(Buffer_base* msg, int32_t port, exlib::string address
if (m_closed)
return CHECK_ERROR(CALL_E_INVALID_CALL);

if (ac->isSync())
return CHECK_ERROR(CALL_E_NOSYNC);

result_t hr;

if (!m_bound) {
hr = bind(0, "", ac);
if (hr < 0)
return hr;
}

if (ac->isSync())
return CHECK_ERROR(CALL_E_NOSYNC);

inetAddr addr_info;

addr_info.init(m_aio.m_family);

0 comments on commit e4b8a26

Please sign in to comment.
You can’t perform that action at this time.