]> granicus.if.org Git - transmission/commitdiff
fix infinite loop in deleteLocalData().
authorJordan Lee <jordan@transmissionbt.com>
Mon, 10 Nov 2014 01:39:14 +0000 (01:39 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Mon, 10 Nov 2014 01:39:14 +0000 (01:39 +0000)
libtransmission/torrent.c

index f5ae254a40a1831596b48bd95242a1fc68cbc3e9..6df5687deaf550ef8ac2570c2e1d5d752da82b6f 100644 (file)
@@ -2887,6 +2887,10 @@ deleteLocalData (tr_torrent * tor, tr_fileFunc func)
   PtrArrayCompareFunc vstrcmp = (PtrArrayCompareFunc)strcmp;
   const char * const top = tor->currentDir;
 
+  /* don't try to delete local data if the directory's gone missing */
+  if (!tr_sys_path_exists (top, NULL))
+    return;
+
   /* if it's a magnet link, there's nothing to move... */
   if (!tr_torrentHasMetadata (tor))
     return;