[MPlayer-cvslog] r35402 - trunk/stream/http.c

reimar subversion at mplayerhq.hu
Sat Nov 10 14:53:29 CET 2012


Author: reimar
Date: Sat Nov 10 14:53:29 2012
New Revision: 35402

Log:
Fix off-by-one errors in file descriptor validity checks.

Modified:
   trunk/stream/http.c

Modified: trunk/stream/http.c
==============================================================================
--- trunk/stream/http.c	Sat Nov 10 14:41:38 2012	(r35401)
+++ trunk/stream/http.c	Sat Nov 10 14:53:29 2012	(r35402)
@@ -717,7 +717,7 @@ static int http_streaming_start(stream_t
 	do
 	{
 		redirect = 0;
-		if (fd > 0) closesocket(fd);
+		if (fd >= 0) closesocket(fd);
 		fd = http_send_request( url, 0 );
 		if( fd<0 ) {
 			goto err_out;
@@ -847,7 +847,7 @@ static int http_streaming_start(stream_t
 	} while( redirect );
 
 err_out:
-	if (fd > 0) closesocket( fd );
+	if (fd >= 0) closesocket( fd );
 	fd = -1;
 	http_free( http_hdr );
 	http_hdr = NULL;


More information about the MPlayer-cvslog mailing list