mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
dvb: Fix sockaddr_un usage
The sun_path field needs to be NULL-terminated CID #206004
This commit is contained in:
parent
c4d5181b09
commit
b9e8ffb4be
1 changed files with 6 additions and 1 deletions
|
@ -76,7 +76,12 @@ 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), FALSE);
|
||||
|
||||
/* sun.path needs to end up NULL-terminated */
|
||||
if (strlen (sock_path) >= (sizeof (addr.sun_path) - 1)) {
|
||||
GST_ERROR ("sock_path is too long");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
addr.sun_family = AF_UNIX;
|
||||
strncpy (addr.sun_path, sock_path, sizeof (addr.sun_path));
|
||||
|
|
Loading…
Reference in a new issue