Changeset 10108


Ignore:
Timestamp:
Feb 6, 2010, 5:21:25 AM (12 years ago)
Author:
charles
Message:

(trunk gtk) don't dereference a NULL pointer if a torrent has no "name"

Location:
trunk/gtk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr-core.c

    r10101 r10108  
    811811doCollate( const char * in )
    812812{
    813     const char * end = in + strlen( in );
    814     char *       casefold;
    815     char *       ret;
     813    char * ret;
     814    char * casefold;
     815    const char * end = in ? in + strlen( in ) : NULL;
    816816
    817817    while( in < end )
  • trunk/gtk/tr-window.c

    r9916 r10108  
    390390
    391391        default: /* NAME */
    392             pch = g_utf8_casefold( inf->name, -1 );
    393             ret = !text || ( strstr( pch, text ) != NULL );
    394             g_free( pch );
     392            if( !inf->name )
     393                ret = TRUE;
     394            else {
     395                pch = g_utf8_casefold( inf->name, -1 );
     396                ret = !text || ( strstr( pch, text ) != NULL );
     397                g_free( pch );
     398            }
    395399            break;
    396400    }
Note: See TracChangeset for help on using the changeset viewer.