Skip to content
Snippets Groups Projects
Commit 87f9be4d authored by Alexander Turenko's avatar Alexander Turenko Committed by Vladimir Davydov
Browse files

socket: prevent recvfrom from returning garbage

In C recvfrom function sets addrlen parameter to zero when called on TCP
socket (at least on Linux). The src_addr parameter can contain garbage
in the case, so we should not dereference it.

Before this commit socket:recvfrom() can return 'from' table with only
family field (don't sure why, but addr->sa_family often contain PF_INET
value in my case) or return nil depending on the garbage at the address.
Now it always return nil.
parent 33950162
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment