[FFmpeg-devel] [PATCH v3 1/2] avformat/url: fix logic for removing ".." path components

Nicolas George george at nsup.org
Wed Jul 29 13:01:24 EEST 2020


Josef Zlomek (12020-07-28):
> Fixes: 8814
> 
> The logic for removing ".." path components and their corresponding
> upper directories was reworked.
> 
> Now, the function trim_double_dot_url splits the path by "/" into
> components, and processes the components one ny one:
> - if the component is "..", the last path component in output buffer is removed
> - if the component is not empty, it is added to the output buffer
> No temporary buffers are used anymore.
> 
> Also the path containing no '/' after '://' is returned as it is.
> 
> The duplicate logic was removed from ff_make_absolute_url.

I am afraid ff_make_absolute_url() as it is is broken beyond repair. For
example:

http://server/menu redirect?url=http://otherserver/target =>
  redirect?url=http://otherserver/target

while the result should have been

http://server/redirect?url=http://otherserver/target

I will have a shot at rewriting it cleanly, with proper parsing of URL
components.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200729/43eb5383/attachment.sig>


More information about the ffmpeg-devel mailing list