[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#449368: axel: segmentation fault when FTP CWD fails



tags 449368 +patch
thanks

On 07/11/05 17:56 +0530, Y Giridhar Appaji Nag said ...
> fd(3)-->200 Type set to I
> fd(3)<--CWD /sites/releases.ubuntu.com/edgy/
> fd(3)-->550 Can't access /sites/releases.ubuntu.com/edgy: No such file or directory
> fd(-1)<--RETR ubuntu-6.10-alternate-i386.iso
> [1]    14433 segmentation fault (core dumped)  ./axel -n 4 

Patch attached to fix this.

Giridhar

-- 
Y Giridhar Appaji Nag | http://www.appaji.net/
diff -Nur original/axel-1.0b/conn.c axel-1.0b/conn.c
--- original/axel-1.0b/conn.c	2005-04-06 23:48:28.000000000 +0530
+++ axel-1.0b/conn.c	2007-11-05 18:05:14.870237000 +0530
@@ -313,7 +313,8 @@
 		do
 		{
 			conn->currentbyte = 1;
-			conn_setup( conn );
+			if( !conn_setup( conn ) )
+				return( 0 );
 			conn_exec( conn );
 			conn_disconnect( conn );
 			/* Code 3xx == redirect				*/
diff -Nur original/axel-1.0b/ftp.c axel-1.0b/ftp.c
--- original/axel-1.0b/ftp.c	2001-12-15 23:29:03.000000000 +0530
+++ axel-1.0b/ftp.c	2007-11-05 18:00:26.236616000 +0530
@@ -87,7 +87,10 @@
 	
 	ftp_command( conn, "CWD %s", cwd );
 	if( ftp_wait( conn ) / 100 != 2 )
+	{
+	  fprintf( stderr, _("Can't change directory to %s\n"), cwd );
 		return( 0 );
+	}
 	
 	strncpy( conn->cwd, cwd, MAX_STRING );
 	

Attachment: signature.asc
Description: Digital signature


Reply to: