[Pidgin] #1037: Pidgin 2.0.0 hangs using SIMPLE

Pidgin trac at pidgin.im
Wed May 30 12:18:52 EDT 2007


#1037: Pidgin 2.0.0 hangs using SIMPLE
---------------------------+------------------------------------------------
  Reporter:  pinkunicorn   |       Owner:                 
      Type:  defect        |      Status:  new            
  Priority:  minor         |   Milestone:  2.0.2          
 Component:  pidgin (gtk)  |     Version:  2.0            
Resolution:                |    Keywords:  simple sip hang
   Pending:  1             |  
---------------------------+------------------------------------------------
Comment (by michal_matyska):

 Copying text from bug #1596326 @sf.net - I think you did not change this
 part of code.

 simple.c

  1235                   while(tmp && tmp < acceptheader +
 strlen(acceptheader)) {
  1236                           gchar *tmp2 = strchr(tmp, ',');
  1237                           if(tmp2) *tmp2 = '\0';
  1238                           if(!strcmp("application/pidf+xml", tmp))
  1239                                   foundpidf = TRUE;
  1240                           if(!strcmp("application/xpidf+xml", tmp))
  1241                                   foundxpidf = TRUE;
  1242                           if(tmp2) {
  1243                                   *tmp2 = ',';
  1244                                   tmp = tmp2;
  1245                                   while(*tmp == ' ') tmp++;
  1246                           } else
  1247                                   tmp = 0;
  1248                   }

 If the accept header contains multiple (at least two) values separated by
 comma, the loop does NEVER end! As you can see on line 1244, tmp is set to
 tmp2, which contains the ',', which was put back one line above, so the
 loop skipping blank space is useless (as *tmp==',' when entering the loop)
 and the outer loop is repeated again and again with the same tmp value.

 Change line 1244 to tmp=tmp2+1; this should help.

-- 
Ticket URL: <http://developer.pidgin.im/ticket/1037#comment:3>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list