mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 11:32:38 +00:00
shmpipe: Fix one byte overflow
This commit is contained in:
parent
2c02d0c0e4
commit
d2731d689d
1 changed files with 2 additions and 2 deletions
|
@ -187,7 +187,7 @@ sp_writer_create (const char *path, size_t size, mode_t perms)
|
||||||
}
|
}
|
||||||
|
|
||||||
sun.sun_family = AF_UNIX;
|
sun.sun_family = AF_UNIX;
|
||||||
strncpy (sun.sun_path, path, sizeof (sun.sun_path));
|
strncpy (sun.sun_path, path, sizeof (sun.sun_path) - 1);
|
||||||
|
|
||||||
while (bind (self->main_socket, (struct sockaddr *) &sun,
|
while (bind (self->main_socket, (struct sockaddr *) &sun,
|
||||||
sizeof (struct sockaddr_un)) < 0) {
|
sizeof (struct sockaddr_un)) < 0) {
|
||||||
|
@ -686,7 +686,7 @@ sp_client_open (const char *path)
|
||||||
}
|
}
|
||||||
|
|
||||||
sun.sun_family = AF_UNIX;
|
sun.sun_family = AF_UNIX;
|
||||||
strncpy (sun.sun_path, path, sizeof (sun.sun_path));
|
strncpy (sun.sun_path, path, sizeof (sun.sun_path) - 1);
|
||||||
|
|
||||||
if (connect (self->main_socket, (struct sockaddr *) &sun,
|
if (connect (self->main_socket, (struct sockaddr *) &sun,
|
||||||
sizeof (struct sockaddr_un)) < 0)
|
sizeof (struct sockaddr_un)) < 0)
|
||||||
|
|
Loading…
Reference in a new issue