mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-18 10:46:23 +00:00
Check the socket isn't too long before copying it to prevent a seg fault.
This commit is contained in:
parent
80b972c455
commit
3a606b7d91
@ -1206,6 +1206,9 @@ int overlay_mdp_client_init()
|
||||
overlay_mdp_client_socket_path_len=strlen(overlay_mdp_client_socket_path)+1;
|
||||
if(debug&DEBUG_IO) DEBUGF("MDP client socket name='%s'",overlay_mdp_client_socket_path);
|
||||
}
|
||||
if (overlay_mdp_client_socket_path_len > 104 - 1)
|
||||
FATALF("MDP socket path too long (%d > %d)", overlay_mdp_client_socket_path_len, 104 - 1);
|
||||
|
||||
bcopy(overlay_mdp_client_socket_path,name.sun_path,
|
||||
overlay_mdp_client_socket_path_len);
|
||||
unlink(name.sun_path);
|
||||
|
Loading…
Reference in New Issue
Block a user