dvb: reject too long socket paths

Coverity 206004
This commit is contained in:
Vincent Penquerc'h 2014-04-08 15:26:04 +01:00
parent 6e764e5b11
commit dd77b7ad79

View file

@ -77,6 +77,7 @@ cam_sw_client_open (CamSwClient * client, const char *sock_path)
g_return_val_if_fail (client != NULL, FALSE);
g_return_val_if_fail (client->state == CAM_SW_CLIENT_STATE_CLOSED, FALSE);
g_return_val_if_fail (sock_path != NULL, FALSE);
g_return_val_if_fail (strlen (sock_path) >= sizeof (addr.sun_path));
addr.sun_family = AF_UNIX;
strncpy (addr.sun_path, sock_path, sizeof (addr.sun_path));