[MPlayer-dev-eng] [PATCH] url opening fix preventing possible segfault

Diego Biurrun diego at biurrun.de
Tue Jul 6 17:00:20 CEST 2004


adland writes:
> file: libmpdemux/open.c
> intention:
> this is a patch which returns NULL if we were
>  supposed to open a URL and this url was invalid -
>  new_url returned null.
> 
> (could happen if invalid data was inside a plaintext
>  playlist and we used command below
> ./mplayer -playlist http://host/playlist
> )
> 
> segfault may then occur in current code as it then
> tries to open invalid url as a file.
> 
> please consider enclosed patch which instead returns 
> in the invalid URL case.
> 
> --- main/libmpdemux/open.c	2004-04-24 09:22:05.000000000 -0400
> +++ updated/libmpdemux/open.c	2004-04-27 22:05:49.000000000 -0400
> @@ -491,7 +491,7 @@
>       url_escape_string(escfilename,filename);
>       mp_msg(MSGT_OPEN,MSGL_V,"Filename for url is now %s\n",escfilename);
>       url = url_new(escfilename);
> -    }
> +
>    if(url) {
>  	if (strcmp(url->protocol, "smb")==0){
>  #ifdef LIBSMBCLIENT
> @@ -540,7 +540,10 @@
>  	url_free(url);
>  	return stream;
>    }
> +  } else {
> +   return NULL;
>    }
> + }
>  #endif
>  
>  //============ Open STDIN or plain FILE ============

Any comments on this?  Was this applied?  Can I drop it from my
tracker?

Diego




More information about the MPlayer-dev-eng mailing list