On 06/01/2011 09:14 AM, Jan Friesse wrote:
> In totemudp_mcast_thread_state_constructor memset to
> sizeof(struct totemudp_mcast_thread_state) instead of size of
> pointer.
> 
> Signed-off-by: Jan Friesse <jfrie...@redhat.com>
> ---
>  exec/totemudp.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/exec/totemudp.c b/exec/totemudp.c
> index 977e754..0420daa 100644
> --- a/exec/totemudp.c
> +++ b/exec/totemudp.c
> @@ -1059,7 +1059,7 @@ static void totemudp_mcast_thread_state_constructor (
>       struct totemudp_mcast_thread_state *totemudp_mcast_thread_state =
>               (struct totemudp_mcast_thread_state 
> *)totemudp_mcast_thread_state_in;
>       memset (totemudp_mcast_thread_state, 0,
> -             sizeof (totemudp_mcast_thread_state));
> +             sizeof (*totemudp_mcast_thread_state));
>  
>       rng_make_prng (128, PRNG_SOBER,
>               &totemudp_mcast_thread_state->prng_state, NULL);

This is why I prefer the use of sizeof in all calls to memcpy/memset.

Reviewed-by: Steven Dake <sd...@redhat.com>
_______________________________________________
Openais mailing list
Openais@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to