forked from enlightenment/efl
ecore_con: add '\0' termination to path.
Summary: Copying from string 'buf' of length 4095 to '&socket_unix.sun_path[0]' may form a non-terminated C string of size 108. So added null termination. Signed-off-by: Prateek Thakur <prateek.th@samsung.com> Reviewers: cedric, thiepha Subscribers: jpeg Differential Revision: https://phab.enlightenment.org/D4247 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
parent
d8cab9347a
commit
9348a84aa0
|
@ -170,7 +170,8 @@ ecore_con_local_connect(Ecore_Con_Server *obj,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strncpy(socket_unix.sun_path, buf, sizeof(socket_unix.sun_path));
|
strncpy(socket_unix.sun_path, buf, sizeof(socket_unix.sun_path) - 1);
|
||||||
|
socket_unix.sun_path[sizeof(socket_unix.sun_path) - 1] = '\0';
|
||||||
socket_unix_len = LENGTH_OF_SOCKADDR_UN(&socket_unix);
|
socket_unix_len = LENGTH_OF_SOCKADDR_UN(&socket_unix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -330,7 +331,8 @@ start:
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
abstract_socket = EINA_FALSE;
|
abstract_socket = EINA_FALSE;
|
||||||
strncpy(socket_unix.sun_path, buf, sizeof(socket_unix.sun_path));
|
strncpy(socket_unix.sun_path, buf, sizeof(socket_unix.sun_path) - 1);
|
||||||
|
socket_unix.sun_path[sizeof(socket_unix.sun_path) - 1] = '\0';
|
||||||
socket_unix_len = LENGTH_OF_SOCKADDR_UN(&socket_unix);
|
socket_unix_len = LENGTH_OF_SOCKADDR_UN(&socket_unix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue