[MPlayer-dev-eng] [PATCH] Fix socket address initialization (was Re: another bug fixing weekend, release postponed)

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Wed Feb 25 13:16:23 CET 2009


On Wed, Feb 25, 2009 at 10:23:24AM +0000, kmkaplan+mplayer-dev-eng at kim.kim-minh.com wrote:
> Index: stream/udp.c
> ===================================================================
> --- stream/udp.c	(revision 28038)
> +++ stream/udp.c	(working copy)
> @@ -103,6 +103,7 @@
>    }
>    server_address.sin_family = AF_INET;
>    server_address.sin_port = htons (url->port);
> +  memset(server_address.sin_zero, 0, sizeof server_address.sin_zero);

This should instead clear all of server_address, before setting any
fields. This probably could be done during declaration by add "= {0}",
but that might be considered ugly. Also in MPlayer code we usually use sizeof with () like a function.



More information about the MPlayer-dev-eng mailing list