Skip to content

Commit 819af63

Browse files
authored
Merge pull request #1851 from Abdullah-Ebryx/patch-2
Fix BOF
2 parents 32d10af + 2aac0f5 commit 819af63

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

contrib/seccomp-receiver/seccomp-receiver.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ open_unix_domain_socket (const char *path)
4747
int fd = socket (AF_UNIX, SOCK_STREAM, 0);
4848
if (fd < 0)
4949
error (EXIT_FAILURE, errno, "error creating UNIX socket");
50-
50+
51+
if (strlen (path) >= sizeof (addr.sun_path))
52+
error (EXIT_FAILURE, 0, "invalid path");
53+
5154
strcpy (addr.sun_path, path);
5255
addr.sun_family = AF_UNIX;
5356
ret = bind (fd, (struct sockaddr *) &addr, sizeof (addr));

0 commit comments

Comments
 (0)