[MPlayer-dev-eng] [PATCH] add -referrer option to allow HTTP referrer to be set

chocolateboy chocolate at cpan.org
Sun May 30 16:54:01 CEST 2010


Thanks for the swift and helpful feedback. I've attached the suggested 
patch (using strlen/malloc).

chocolateboy

On 30/05/10 12:37, Reimar Döffinger wrote:
> On Sun, May 30, 2010 at 11:55:36AM +0100, chocolateboy wrote:
>    
>> The attached patch adds support for a new -referrer option, which
>> allows a HTTP referrer header to be set. The rationale is the same
>> as for the existing -user-agent and cookie-related options.
>>      
> I'm tempted to say that at some point people should just pipe the
> data through wget :-)
>
>    
>> @@ -226,6 +227,13 @@
>>   	else
>>   	    http_set_field( http_hdr, "User-Agent: MPlayer/"VERSION);
>>
>> +	if (network_referrer)
>> +	{
>> +	    char referrer[2048]; /* http://www.boutell.com/newfaq/misc/urllength.html */
>> +	    snprintf(referrer, 2048, "Referer: %s", network_referrer);
>>      
> use sizeof(referrer)
> Also URLs aren't really good as comments, particularly since that page says 2048 is the
> limit for the URL length, but here you put in the URL _and_ the string "Referer: ".
> Since speed does not matter you could just malloc the space (just make sure that an integer
> overflow does not make it exploitable).
> In principle the patch is fine though.
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
>
>
>    
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mplayer_referrer.patch.txt
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20100530/fd9b2b2e/attachment.txt>


More information about the MPlayer-dev-eng mailing list