im.pidgin.pidgin: 040eda39d04e967c5904d63394086090b449dd17

John Bailey rekkanoryo at rekkanoryo.org
Fri Feb 1 19:39:08 EST 2008


resiak at soc.pidgin.im wrote:
> ChangeLog: 
> 
> Passing NULL to msn_user_set_friendly_name explodes, and msn_user_new is called
> by session.c with friendly_name unconditionally NULL, so I have no idea why
> this ever worked.
>
> ============================================================
> --- libpurple/protocols/msnp9/user.c	92a67c2d9914c87de46146f76f97a1bd8fed8258
> +++ libpurple/protocols/msnp9/user.c	58a59bd522734e7d219a276ce4ee6311a2982c42
> @@ -36,7 +36,8 @@ msn_user_new(MsnUserList *userlist, cons
>  	user->userlist = userlist;
>  
>  	msn_user_set_passport(user, passport);
> -	msn_user_set_friendly_name(user, friendly_name);
> +	if (friendly_name != NULL)
> +		msn_user_set_friendly_name(user, friendly_name);
>  
>  	return user;
>  }

Shouldn't the NULL check be in msn_user_set_friendly_name() so that the function
just silently fails instead of crashing?

John

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
URL: <http://pidgin.im/pipermail/devel/attachments/20080201/95c2eee0/attachment.sig>


More information about the Devel mailing list