changeset 32422:01115062cb22

Fix possible crash for invalid http_proxy URLs like just "http_proxy://".
author reimar
date Sun, 17 Oct 2010 16:10:17 +0000
parents 12732436bc8a
children 4a3bfd196e17
files stream/network.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/stream/network.c	Sun Oct 17 16:00:04 2010 +0000
+++ b/stream/network.c	Sun Oct 17 16:10:17 2010 +0000
@@ -205,6 +205,10 @@
 	if( !strcasecmp(url->protocol, "http_proxy") ) {
 		proxy = 1;
 		server_url = url_new( (url->file)+1 );
+		if (!server_url) {
+			mp_msg(MSGT_NETWORK, MSGL_ERR, "Invalid URL '%s' to proxify\n", url->file+1);
+			goto err_out;
+		}
 		http_set_uri( http_hdr, server_url->url );
 	} else {
 		server_url = url;