[Pidgin] #11877: Segmentation fault, oscar_normalize()

Pidgin trac at pidgin.im
Fri May 14 07:14:14 EDT 2010


#11877: Segmentation fault, oscar_normalize()
--------------------+-------------------------------------------------------
Reporter:  msschlt  |        Type:  defect                            
  Status:  new      |   Component:  libpurple                         
 Version:  2.7.0    |    Keywords:  Segmentation fault oscar_normalize
--------------------+-------------------------------------------------------
 If i receive an ICQ msg sent via Adium 1.3.10 (Mac OSX 10.6.3) I get
 these:

 Program received signal SIGSEGV, Segmentation fault.

 #0  0x00007ffff4a99ca0 in __strcpy_chk () from /lib/libc.so.6

 #1  0x00007fffe595d846 in oscar_normalize () from
 /usr/lib/purple-2/liboscar.so.0


 pidgin 2.7.0, libpurple/protocols/oscar/oscar.c, oscar_normalize():

         tmp1 = g_utf8_strdown(buf, -1);

         tmp2 = g_utf8_normalize(tmp1, -1, G_NORMALIZE_DEFAULT);

         //g_utf8_normalize(), man: Returns :    NULL if str is not valid
 UTF-8.

         strcpy(buf, tmp2);      //crash, because tmp2 = NULL


 My workaround:

         tmp1 = g_utf8_strdown(buf, -1);

         if(!g_utf8_validate(tmp1, -1, NULL)) {

                 g_free(tmp1);

                 return NULL;

         }

         tmp2 = g_utf8_normalize(tmp1, -1, G_NORMALIZE_DEFAULT);

         strcpy(buf, tmp2);

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


More information about the Tracker mailing list