summaryrefslogtreecommitdiff
path: root/src/lib/eina
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-11-06 16:52:01 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-11-09 11:43:58 +0000
commitea9ab2dd5a8026740a27ac726c8ca09b348dbf78 (patch)
tree89effd554551029533d80a4c80115d0a9a14c5cd /src/lib/eina
parent01139b419df55f0776b950b7dfca2d2647bbd34e (diff)
eina debug - fix buffer truncation warning
make buf the size of the unix socket path to truncate early to avoid warning
Diffstat (limited to 'src/lib/eina')
-rw-r--r--src/lib/eina/eina_debug.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/eina/eina_debug.c b/src/lib/eina/eina_debug.c
index 4d003bf029..d46b18bb00 100644
--- a/src/lib/eina/eina_debug.c
+++ b/src/lib/eina/eina_debug.c
@@ -496,9 +496,9 @@ EAPI Eina_Debug_Session *
496eina_debug_local_connect(Eina_Bool is_master) 496eina_debug_local_connect(Eina_Bool is_master)
497{ 497{
498#ifndef _WIN32 498#ifndef _WIN32
499 char buf[4096];
500 int fd, socket_unix_len, curstate = 0; 499 int fd, socket_unix_len, curstate = 0;
501 struct sockaddr_un socket_unix; 500 struct sockaddr_un socket_unix;
501 char buf[sizeof(socket_unix.sun_path)];
502 502
503 if (is_master) return eina_debug_remote_connect(REMOTE_SERVER_PORT); 503 if (is_master) return eina_debug_remote_connect(REMOTE_SERVER_PORT);
504 504
@@ -520,7 +520,8 @@ eina_debug_local_connect(Eina_Bool is_master)
520 // sa that it's a unix socket and where the path is 520 // sa that it's a unix socket and where the path is
521 memset(&socket_unix, 0, sizeof(socket_unix)); 521 memset(&socket_unix, 0, sizeof(socket_unix));
522 socket_unix.sun_family = AF_UNIX; 522 socket_unix.sun_family = AF_UNIX;
523 strncpy(socket_unix.sun_path, buf, sizeof(socket_unix.sun_path) - 1); 523 strncpy(socket_unix.sun_path, buf, sizeof(socket_unix.sun_path));
524 socket_unix.sun_path[sizeof(socket_unix.sun_path) - 1] = 0;
524 socket_unix_len = LENGTH_OF_SOCKADDR_UN(&socket_unix); 525 socket_unix_len = LENGTH_OF_SOCKADDR_UN(&socket_unix);
525 // actually connect to efl_debugd service 526 // actually connect to efl_debugd service
526 if (connect(fd, (struct sockaddr *)&socket_unix, socket_unix_len) < 0) 527 if (connect(fd, (struct sockaddr *)&socket_unix, socket_unix_len) < 0)