Package: transmission-cli
Version: 1.22-1
Severity: minor
Tags: patch

If you try to create a torrent (-c option) and dont give an announce URL
(-a option), transmissioncli segfaults.

Here are two patches, the 1st one prevents the segmentation fault, the
second display an error message at command line parsing.

--- libtransmission/utils.c    2008-06-14 00:00:42.000000000 +0200
+++ libtransmission/utils.c.new    2009-06-19 14:20:32.000000000 +0200
@@ -968,6 +968,9 @@
     const char * host = NULL;
     const char * path = NULL;
 
+    if (!(url_in && *url_in))
+       return TRUE;
+
     tmp = tr_strndup( url_in, len );
     if(( pch = strstr( tmp, "://" )))



--- cli/transmissioncli.c    2008-06-14 00:00:51.000000000 +0200
+++ cli/transmissioncli.c.new    2009-06-19 14:20:47.000000000 +0200
@@ -221,14 +221,22 @@
     if( sourceFile && *sourceFile ) /* creating a torrent */
     {
         int err;
-        tr_metainfo_builder * builder = tr_metaInfoBuilderCreate( h,
sourceFile );
-        tr_makeMetaInfo( builder, torrentPath, announce, comment,
isPrivate );
-        while( !builder->isDone ) {
-            tr_wait( 1000 );
-            printf( "." );
+        if (!(announce && *announce))
+        {
+        err=-1;
+            fprintf( stderr, "You must specify an annouce URL to create
a torrent\n");
+        }
+        else
+        {
+            tr_metainfo_builder * builder = tr_metaInfoBuilderCreate(
h, sourceFile );
+            tr_makeMetaInfo( builder, torrentPath, announce, comment,
isPrivate );
+            while( !builder->isDone ) {
+                tr_wait( 1000 );
+                printf( "." );
+            }
+            err = builder->result;
+            tr_metaInfoBuilderFree( builder );
         }
-        err = builder->result;
-        tr_metaInfoBuilderFree( builder );
         return err;
     }


-- System Information:
Debian Release: 5.0.1
  APT prefers stable
  APT policy: (990, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.30 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages transmission-cli depends on:
ii  libc6           2.7-18                   GNU C Library: Shared libraries
ii  libcomerr2      1.41.3-1                 common error description
library
ii  libcurl3        7.18.2-8lenny2           Multi-protocol file
transfer libra
ii  libidn11        1.8+20080606-1           GNU libidn library,
implementation
ii  libkrb53        1.6.dfsg.4~beta1-5lenny1 MIT Kerberos runtime libraries
ii  libldap-2.4-2   2.4.11-1                 OpenLDAP libraries
ii  libssh2-1       0.18-1                   SSH2 client-side library
ii  libssl0.9.8     0.9.8g-15+lenny1         SSL shared libraries
ii  transmission-co 1.22-1                   free, lightweight
BitTorrent clien
ii  zlib1g          1:1.2.3.3.dfsg-12        compression library - runtime

transmission-cli recommends no packages.

transmission-cli suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to