summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrique Dante de Almeida <hdante@profusion.mobi>2013-01-28 17:12:50 -0200
committerLucas De Marchi <lucas.demarchi@profusion.mobi>2013-02-26 10:17:28 -0300
commitf5d4ae70bd1ff8fba17ebd3e2eb6c65f354185d4 (patch)
tree4ebfba9d746fb6b730fadd2ee41824cae96b2526
parent683e5d7d0848b0b044eca151c61ad2254dac2e63 (diff)
evas: Fix buffer overflows on environment variables
-rw-r--r--src/bin/evas/evas_cserve2_client.c2
-rw-r--r--src/bin/evas/evas_cserve2_debug.c2
-rw-r--r--src/bin/evas/evas_cserve2_main_loop_linux.c2
-rw-r--r--src/bin/evas/evas_cserve2_usage.c2
-rw-r--r--src/lib/evas/cserve2/evas_cs2_client.c2
5 files changed, 5 insertions, 5 deletions
diff --git a/src/bin/evas/evas_cserve2_client.c b/src/bin/evas/evas_cserve2_client.c
index 9d63b87abf..91999f0ef0 100644
--- a/src/bin/evas/evas_cserve2_client.c
+++ b/src/bin/evas/evas_cserve2_client.c
@@ -369,7 +369,7 @@ int main(void)
369 (int)getuid()); 369 (int)getuid());
370 env = buf; 370 env = buf;
371 } 371 }
372 strncpy(remote.sun_path, env, UNIX_PATH_MAX - 1); 372 eina_strlcpy(remote.sun_path, env, UNIX_PATH_MAX);
373 len = strlen(remote.sun_path) + sizeof(remote.sun_family); 373 len = strlen(remote.sun_path) + sizeof(remote.sun_family);
374 if (connect(s, (struct sockaddr *)&remote, len) == -1) 374 if (connect(s, (struct sockaddr *)&remote, len) == -1)
375 { 375 {
diff --git a/src/bin/evas/evas_cserve2_debug.c b/src/bin/evas/evas_cserve2_debug.c
index 1dd67c7807..ce8e3e43f1 100644
--- a/src/bin/evas/evas_cserve2_debug.c
+++ b/src/bin/evas/evas_cserve2_debug.c
@@ -49,7 +49,7 @@ _socket_path_set(char *path)
49 env = getenv("EVAS_CSERVE2_SOCKET"); 49 env = getenv("EVAS_CSERVE2_SOCKET");
50 if (env && env[0]) 50 if (env && env[0])
51 { 51 {
52 strncpy(path, env, UNIX_PATH_MAX - 1); 52 eina_strlcpy(path, env, UNIX_PATH_MAX);
53 return; 53 return;
54 } 54 }
55 55
diff --git a/src/bin/evas/evas_cserve2_main_loop_linux.c b/src/bin/evas/evas_cserve2_main_loop_linux.c
index 0fd40ea942..ca156f2597 100644
--- a/src/bin/evas/evas_cserve2_main_loop_linux.c
+++ b/src/bin/evas/evas_cserve2_main_loop_linux.c
@@ -210,7 +210,7 @@ _socket_path_set(char *path)
210 env = getenv("EVAS_CSERVE2_SOCKET"); 210 env = getenv("EVAS_CSERVE2_SOCKET");
211 if (env && env[0]) 211 if (env && env[0])
212 { 212 {
213 strncpy(path, env, UNIX_PATH_MAX - 1); 213 eina_strlcpy(path, env, UNIX_PATH_MAX);
214 return; 214 return;
215 } 215 }
216 216
diff --git a/src/bin/evas/evas_cserve2_usage.c b/src/bin/evas/evas_cserve2_usage.c
index 2aa3ff3650..294f5c3747 100644
--- a/src/bin/evas/evas_cserve2_usage.c
+++ b/src/bin/evas/evas_cserve2_usage.c
@@ -49,7 +49,7 @@ _socket_path_set(char *path)
49 env = getenv("EVAS_CSERVE2_SOCKET"); 49 env = getenv("EVAS_CSERVE2_SOCKET");
50 if (env && env[0]) 50 if (env && env[0])
51 { 51 {
52 strncpy(path, env, UNIX_PATH_MAX - 1); 52 eina_strlcpy(path, env, UNIX_PATH_MAX);
53 return; 53 return;
54 } 54 }
55 55
diff --git a/src/lib/evas/cserve2/evas_cs2_client.c b/src/lib/evas/cserve2/evas_cs2_client.c
index dd91db7339..43bdd239d3 100644
--- a/src/lib/evas/cserve2/evas_cs2_client.c
+++ b/src/lib/evas/cserve2/evas_cs2_client.c
@@ -56,7 +56,7 @@ _socket_path_set(char *path)
56 env = getenv("EVAS_CSERVE2_SOCKET"); 56 env = getenv("EVAS_CSERVE2_SOCKET");
57 if (env && env[0]) 57 if (env && env[0])
58 { 58 {
59 strncpy(path, env, UNIX_PATH_MAX - 1); 59 eina_strlcpy(path, env, UNIX_PATH_MAX);
60 return; 60 return;
61 } 61 }
62 62