evas: Fix buffer overflows on environment variables

This commit is contained in:
Henrique Dante de Almeida 2013-01-28 17:12:50 -02:00 committed by Lucas De Marchi
parent 683e5d7d08
commit f5d4ae70bd
5 changed files with 5 additions and 5 deletions

View File

@ -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)
{

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}