Ignore:
Timestamp:
Jul 30, 2011, 1:11:06 PM (10 years ago)
Author:
jordan
Message:

(trunk libT) #4395 "Crash when removing data for incomplete magnetized torrent file" -- fixed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r12540 r12600  
    27122712{
    27132713    int i, n;
     2714    char * tmp;
     2715    char * root;
    27142716    char ** s;
    27152717    tr_file_index_t f;
     2718    const char * cpch;
     2719    const char * firstFile;
    27162720    tr_ptrArray torrentFiles = TR_PTR_ARRAY_INIT;
    27172721    tr_ptrArray folders      = TR_PTR_ARRAY_INIT;
    27182722    tr_ptrArray dirtyFolders = TR_PTR_ARRAY_INIT; /* dirty == contains non-torrent files */
    27192723
    2720     const char * firstFile = tor->info.files[0].name;
    2721     const char * cpch = strchr( firstFile, TR_PATH_DELIMITER );
    2722     char * tmp = cpch ? tr_strndup( firstFile, cpch - firstFile ) : NULL;
    2723     char * root = tr_buildPath( tor->currentDir, tmp, NULL );
     2724    if( !tr_torrentHasMetadata( tor ) )
     2725        return;
     2726
     2727    firstFile = tor->info.files[0].name;
     2728    cpch = strchr( firstFile, TR_PATH_DELIMITER );
     2729    tmp = cpch ? tr_strndup( firstFile, cpch - firstFile ) : NULL;
     2730    root = tr_buildPath( tor->currentDir, tmp, NULL );
    27242731
    27252732    for( f=0; f<tor->info.fileCount; ++f ) {
Note: See TracChangeset for help on using the changeset viewer.