mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-19 05:07:56 +00:00
Fixed problem with null-termination of received addresses for
unix domain socket connections.
This commit is contained in:
parent
54da5f3ffc
commit
0b11389023
@ -815,6 +815,8 @@ int overlay_mdp_recv(overlay_mdp_frame *mdp,int *ttl)
|
||||
int len = recvwithttl(mdp_client_socket,(unsigned char *)mdp,
|
||||
sizeof(overlay_mdp_frame),ttl,recvaddr,&recvaddrlen);
|
||||
recvaddr_un=(struct sockaddr_un *)recvaddr;
|
||||
/* Null terminate received address so that the stat() call below can succeed */
|
||||
if (recvaddrlen<1024) recvaddrbuffer[recvaddrlen]=0;
|
||||
if (len>0) {
|
||||
/* Make sure recvaddr matches who we sent it to */
|
||||
if (strncmp(mdp_socket_name, recvaddr_un->sun_path, sizeof(recvaddr_un->sun_path))) {
|
||||
|
Loading…
Reference in New Issue
Block a user