mirror of
https://github.com/transmission/transmission.git
synced 2026-05-08 09:39:08 +01:00
(trunk gtk) don't dereference a NULL pointer if a torrent has no "name"
This commit is contained in:
+3
-3
@@ -810,9 +810,9 @@ tr_core_session( TrCore * core )
|
||||
static char*
|
||||
doCollate( const char * in )
|
||||
{
|
||||
const char * end = in + strlen( in );
|
||||
char * casefold;
|
||||
char * ret;
|
||||
char * ret;
|
||||
char * casefold;
|
||||
const char * end = in ? in + strlen( in ) : NULL;
|
||||
|
||||
while( in < end )
|
||||
{
|
||||
|
||||
+7
-3
@@ -389,9 +389,13 @@ checkFilterText( filter_text_mode_t filter_text_mode,
|
||||
break;
|
||||
|
||||
default: /* NAME */
|
||||
pch = g_utf8_casefold( inf->name, -1 );
|
||||
ret = !text || ( strstr( pch, text ) != NULL );
|
||||
g_free( pch );
|
||||
if( !inf->name )
|
||||
ret = TRUE;
|
||||
else {
|
||||
pch = g_utf8_casefold( inf->name, -1 );
|
||||
ret = !text || ( strstr( pch, text ) != NULL );
|
||||
g_free( pch );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user