Potentially overflowing fix for 'home'

This commit is contained in:
Alexander Naumov
2024-06-26 10:40:23 +02:00
parent 4b52c01265
commit b4e5968f0b

View File

@@ -789,6 +789,8 @@ int main(int argc, char **argv)
} else {
#ifndef SOCKET_DIR
if (SocketDir == NULL) {
if (strlen(home) > MAXPATHLEN - 8)
Panic(0, "$HOME too long - sorry.");
sprintf(SocketPath, "%s/.screen", home);
SocketDir = SocketPath;
}