[Pidgin] #15167: purple_core_get_ui() and purple_core_get_version() returns nonsense on 64b

Pidgin trac at pidgin.im
Thu Jun 14 18:11:26 EDT 2012

#15167: purple_core_get_ui() and purple_core_get_version() returns nonsense on 64b
Reporter:  harvie  |        Type:  defect                    
  Status:  new     |   Component:  libpurple                 
 Version:  2.10.4  |    Keywords:  amd64 x86-64 64b libpurple
 I am author of answerscripts plugin and i my users reported issues with
 libpurple/pidgin on 64b.


 Here is the code that crashes and therefore i had to disable it on x86_64:

         #ifndef __x86_64__ //Workaround for x86_64 (where this causes
 problems pro unknown reason)
                 const char * core_ui = purple_core_get_ui() != 0 ? (const
 char *) purple_core_get_ui() : "";
                 const char * core_version = purple_core_get_version() != 0
 ? (const char *) purple_core_get_version() : "";
                 setenv(ENV_PREFIX "L_AGENT", (char *) core_ui, 1);
 //ID of IM client used with answerscripts
                 setenv(ENV_PREFIX "L_AGENT_VERSION", (char *)
 core_version, 1); //Version of client

 I don't know why but purple_core_get_ui() and purple_core_get_version()
 just returns invalid non-NULL pointer that makes pidgin SEGV when trying
 to read it...

 BTW i have similar problems with some other functions (in this case even
 on 32b) which are returning valid pointers to some binary mess instead of
 null pointers when property is unset. I am not sure which functions are
 affected right now, but all of them were related to user nicknames, names,
 aliases and other similar stuff made to identify remote and local users.

 Like this:

 //Get buddy alias
         const char* remote_alias = purple_buddy_get_alias(buddy);
         if(remote_alias == NULL) remote_alias = "";

 never returns NULL even if alias is unset... returns pointer to crap
 instead... but it's not so crucial as i don't have any frequent crashes
 caused by this... just mess in output in some cases...

Ticket URL: <http://developer.pidgin.im/ticket/15167>
Pidgin <http://pidgin.im>

More information about the Tracker mailing list