aboutsummaryrefslogtreecommitdiffstats
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)
downloadefl-f5d4ae70bd1ff8fba17ebd3e2eb6c65f354185d4.tar.gz
efl-f5d4ae70bd1ff8fba17ebd3e2eb6c65f354185d4.tar.xz
efl-f5d4ae70bd1ff8fba17ebd3e2eb6c65f354185d4.zip
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 9d63b87ab..91999f0ef 100644
--- a/src/bin/evas/evas_cserve2_client.c
+++ b/src/bin/evas/evas_cserve2_client.c
@@ -369,7 +369,7 @@ int main(void)
(int)getuid());
env = buf;
}
- strncpy(remote.sun_path, env, UNIX_PATH_MAX - 1);
+ eina_strlcpy(remote.sun_path, env, UNIX_PATH_MAX);
len = strlen(remote.sun_path) + sizeof(remote.sun_family);
if (connect(s, (struct sockaddr *)&remote, len) == -1)
{
diff --git a/src/bin/evas/evas_cserve2_debug.c b/src/bin/evas/evas_cserve2_debug.c
index 1dd67c780..ce8e3e43f 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)
env = getenv("EVAS_CSERVE2_SOCKET");
if (env && env[0])
{
- strncpy(path, env, UNIX_PATH_MAX - 1);
+ eina_strlcpy(path, env, UNIX_PATH_MAX);
return;
}
diff --git a/src/bin/evas/evas_cserve2_main_loop_linux.c b/src/bin/evas/evas_cserve2_main_loop_linux.c
index 0fd40ea94..ca156f259 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)
env = getenv("EVAS_CSERVE2_SOCKET");
if (env && env[0])
{
- strncpy(path, env, UNIX_PATH_MAX - 1);
+ eina_strlcpy(path, env, UNIX_PATH_MAX);
return;
}
diff --git a/src/bin/evas/evas_cserve2_usage.c b/src/bin/evas/evas_cserve2_usage.c
index 2aa3ff365..294f5c374 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)
env = getenv("EVAS_CSERVE2_SOCKET");
if (env && env[0])
{
- strncpy(path, env, UNIX_PATH_MAX - 1);
+ eina_strlcpy(path, env, UNIX_PATH_MAX);
return;
}
diff --git a/src/lib/evas/cserve2/evas_cs2_client.c b/src/lib/evas/cserve2/evas_cs2_client.c
index dd91db733..43bdd239d 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)
env = getenv("EVAS_CSERVE2_SOCKET");
if (env && env[0])
{
- strncpy(path, env, UNIX_PATH_MAX - 1);
+ eina_strlcpy(path, env, UNIX_PATH_MAX);
return;
}