aboutsummaryrefslogtreecommitdiff
path: root/tests/vhost-user-bridge.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/vhost-user-bridge.c')
-rw-r--r--tests/vhost-user-bridge.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c
index 24815920b2..cb009545fa 100644
--- a/tests/vhost-user-bridge.c
+++ b/tests/vhost-user-bridge.c
@@ -540,6 +540,11 @@ vubr_new(const char *path, bool client)
CallbackFunc cb;
size_t len;
+ if (strlen(path) >= sizeof(un.sun_path)) {
+ fprintf(stderr, "unix domain socket path '%s' is too long\n", path);
+ exit(1);
+ }
+
/* Get a UNIX socket. */
dev->sock = socket(AF_UNIX, SOCK_STREAM, 0);
if (dev->sock == -1) {