mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-05 05:22:47 -05:00
Properly check the lengths of Unix-socket pathnames.
If something is too long to fit in a sun_addr, we should spot that well in advance and not try.
This commit is contained in:
@ -1620,7 +1620,8 @@ SockAddr unix_sock_addr(const char *path)
|
||||
|
||||
if (n < 0)
|
||||
ret->error = "snprintf failed";
|
||||
else if (n >= sizeof ret->hostname)
|
||||
else if (n >= sizeof ret->hostname ||
|
||||
n >= sizeof(((struct sockaddr_un *)0)->sun_path))
|
||||
ret->error = "socket pathname too long";
|
||||
|
||||
#ifndef NO_IPV6
|
||||
|
Reference in New Issue
Block a user