Skip to content

Commit e887bfd

Browse files
authored
Merge pull request #1850 from Abdullah-Ebryx/patch-1
Fixed BOF
2 parents ca8e5c7 + d417e0a commit e887bfd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

contrib/terminal-receiver/terminal-receiver.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ open_unix_domain_socket (const char *path)
5050
int fd = socket (AF_UNIX, SOCK_STREAM, 0);
5151
if (fd < 0)
5252
error (EXIT_FAILURE, errno, "error creating UNIX socket");
53-
53+
if (strlen (path) >= sizeof (addr.sun_path))
54+
error (EXIT_FAILURE, 0, "invalid path");
55+
5456
strcpy (addr.sun_path, path);
5557
addr.sun_family = AF_UNIX;
5658
ret = bind (fd, (struct sockaddr *) &addr, sizeof (addr));

0 commit comments

Comments
 (0)