mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
udputils: initialize struct content with 0.
Fixes some random crashes.
This commit is contained in:
parent
b3c55f5ce5
commit
efcfb89b5c
1 changed files with 4 additions and 0 deletions
|
@ -178,6 +178,7 @@ gst_udp_join_group (int sockfd, struct sockaddr_storage *addr, gchar * iface)
|
|||
struct ip_mreq mreq4;
|
||||
#endif
|
||||
|
||||
memset (&mreq4, 0, sizeof (mreq4));
|
||||
mreq4.imr_multiaddr.s_addr =
|
||||
((struct sockaddr_in *) addr)->sin_addr.s_addr;
|
||||
#ifdef HAVE_IP_MREQN
|
||||
|
@ -200,6 +201,7 @@ gst_udp_join_group (int sockfd, struct sockaddr_storage *addr, gchar * iface)
|
|||
{
|
||||
struct ipv6_mreq mreq6;
|
||||
|
||||
memset (&mreq6, 0, sizeof (mreq6));
|
||||
memcpy (&mreq6.ipv6mr_multiaddr,
|
||||
&(((struct sockaddr_in6 *) addr)->sin6_addr),
|
||||
sizeof (struct in6_addr));
|
||||
|
@ -236,6 +238,7 @@ gst_udp_leave_group (int sockfd, struct sockaddr_storage *addr)
|
|||
{
|
||||
struct ip_mreq mreq4;
|
||||
|
||||
memset (&mreq4, 0, sizeof (mreq4));
|
||||
mreq4.imr_multiaddr.s_addr =
|
||||
((struct sockaddr_in *) addr)->sin_addr.s_addr;
|
||||
mreq4.imr_interface.s_addr = INADDR_ANY;
|
||||
|
@ -251,6 +254,7 @@ gst_udp_leave_group (int sockfd, struct sockaddr_storage *addr)
|
|||
{
|
||||
struct ipv6_mreq mreq6;
|
||||
|
||||
memset (&mreq6, 0, sizeof (mreq6));
|
||||
memcpy (&mreq6.ipv6mr_multiaddr,
|
||||
&(((struct sockaddr_in6 *) addr)->sin6_addr),
|
||||
sizeof (struct in6_addr));
|
||||
|
|
Loading…
Reference in a new issue