Skip to content

Commit

Permalink
udp: fix segfault if address is NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
koehlma committed Feb 13, 2016
1 parent 3668ca1 commit e46cdff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion uv/handles/udp.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ def uv_udp_recv_cb(udp_handle, length, uv_buf, c_sockaddr, flags):
length, status = 0, length
else:
status = error.StatusCodes.SUCCESS
address = dns.unpack_sockaddr(c_sockaddr)
if c_sockaddr:
address = dns.unpack_sockaddr(c_sockaddr)
else:
address = None
udp_handle.on_receive(udp_handle, status, address, length, data, flags)


Expand Down

0 comments on commit e46cdff

Please sign in to comment.