forked from enlightenment/efl
evas: Fix buffer overflows on environment variables
This commit is contained in:
parent
683e5d7d08
commit
f5d4ae70bd
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue