Changeset 7657


Ignore:
Timestamp:
Jan 10, 2009, 10:56:26 PM (12 years ago)
Author:
charles
Message:

(trunk libT) #1634: better utf8 validation of metainfo "files" field

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/metainfo.c

    r7656 r7657  
    153153        }
    154154
    155         *setme = tr_strndup( EVBUFFER_DATA( buf ), EVBUFFER_LENGTH( buf ) );
     155        *setme = tr_utf8clean( (char*)EVBUFFER_DATA( buf ), EVBUFFER_LENGTH( buf ), NULL );
    156156        /* fprintf( stderr, "[%s]\n", *setme ); */
    157157        tr_releaseBuffer( buf );
     
    423423
    424424    /* files */
    425     if( ( str =
    426              parseFiles( inf,
    427                         tr_bencDictFind( beInfo,
    428                                          "files" ),
    429                         tr_bencDictFind( beInfo, "length" ) ) ) )
     425    if( ( str = parseFiles( inf, tr_bencDictFind( beInfo, "files" ),
     426                                 tr_bencDictFind( beInfo, "length" ) ) ) )
    430427        return str;
    431428    if( !inf->fileCount || !inf->totalSize )
Note: See TracChangeset for help on using the changeset viewer.