summaryrefslogtreecommitdiff
path: root/security/gvm-libs/files/patch-osp_osp.c
blob: a9cae258b0e4dce3bf70664188db0139ff0fd737 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- osp/osp.c	2021-01-03 15:42:39.761321000 -0500
+++ osp/osp.c	2021-01-03 15:48:50.962832000 -0500
@@ -134,7 +134,6 @@
   if (host && *host == '/')
     {
       struct sockaddr_un addr;
-      int len;
 
       connection = g_malloc0 (sizeof (*connection));
       connection->socket = socket (AF_UNIX, SOCK_STREAM, 0);
@@ -142,9 +141,8 @@
         return NULL;
 
       addr.sun_family = AF_UNIX;
-      strncpy (addr.sun_path, host, sizeof (addr.sun_path) - 1);
-      len = strlen (addr.sun_path) + sizeof (addr.sun_family);
-      if (connect (connection->socket, (struct sockaddr *) &addr, len) == -1)
+      strcpy (addr.sun_path, host);
+      if (connect (connection->socket, (struct sockaddr *) &addr, sizeof(struct sockaddr_un)) == -1)
         {
           close (connection->socket);
           return NULL;