[FFmpeg-devel] [PATCH] Handling special characters in a URL.

Senthilnathan Maadasamy senthilnathan.maadasamy at gmail.com
Fri Mar 1 19:10:03 CET 2013


On Fri, Mar 1, 2013 at 8:48 AM, Michael Niedermayer <michaelni at gmx.at>wrote:

> On Fri, Mar 01, 2013 at 08:02:44AM +0530, Senthilnathan Maadasamy wrote:
> > On Fri, Mar 1, 2013 at 7:49 AM, Michael Niedermayer <michaelni at gmx.at
> >wrote:
> >
> > > > No.  The previous two comparisons of enc_len with MAX_URL_SIZE make
> sure
> > > > that there is always place for the trailing NULL character.
> > >
> > > consider component_size == 0
> > >
> > I tested with component_size as zero and it properly logs the error
> message
> > that buffer size is too small.
>
> but first it accesses out of the array

Hi Michael,
          The array enc is declared locally within the percent_encode_url
function with size MAX_URL_SIZE (4096) and is independent of
component_size.  If the buffer component (which is of size component_size)
cannot hold the percent_encoded URL the original string is returned in
component (with a logged error message).  The only case which is not
correctly handled in the code is this: component_size > MAX_URL_SIZE &
length (percent encoded URL) > MAX_URL_SIZE.  In this case the returned
component buffer contains only the partial encoded URL and not the complete
one.  I think this case is very unlikely, since most of the URL (percent
encoded) should be of size < 4096.  Let me know if I am missing something
very basic.

Thanks,
Senthil


More information about the ffmpeg-devel mailing list