[MPlayer-dev-eng] [PATCH] Fix crash with empty http_proxy

Clément Bœsch ubitux at gmail.com
Sat Oct 16 19:45:16 CEST 2010


Hi,

MPlayer crashes on "mplayer http_proxy://", so here is a small patch to
fix the issue.

Regards,

-- 
Clément B.
-------------- next part --------------
Index: stream/network.c
===================================================================
--- stream/network.c	(revision 32493)
+++ stream/network.c	(working copy)
@@ -205,6 +205,8 @@
 	if( !strcasecmp(url->protocol, "http_proxy") ) {
 		proxy = 1;
 		server_url = url_new( (url->file)+1 );
+		if (!server_url)
+			goto err_out;
 		http_set_uri( http_hdr, server_url->url );
 	} else {
 		server_url = url;
Index: stream/url.c
===================================================================
--- stream/url.c	(revision 32493)
+++ stream/url.c	(working copy)
@@ -66,7 +66,7 @@
 	char *ptr1=NULL, *ptr2=NULL, *ptr3=NULL, *ptr4=NULL;
 	int jumpSize = 3;
 
-	if( url==NULL ) return NULL;
+	if( url==NULL || !*url ) return NULL;
 
         if (strlen(url) > (SIZE_MAX / 3 - 1)) {
                 mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);


More information about the MPlayer-dev-eng mailing list