[FFmpeg-devel] [PATCH v2 1/2] avformat/url: check double dot is not to parent directory
Nicolas George
george at nsup.org
Sat Jul 25 11:34:22 EEST 2020
刘歧 (12020-07-25):
> I think the best would be to use strtok(p, "/") to split the path into the
> components and for each ".." component remove the previous one (if there
> are some still).
> I think you can submit patch if you have full idea for it.
strtok() is a terrible API, and better not used, but you are right, the
logic of the parsing is flawed.
I would suggest to keep walk from / to / (using strchr() probably), and
keep a pointer on the last two in the source and the last one in the
target IIRC.
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/20200725/0e63ea81/attachment.sig>
More information about the ffmpeg-devel
mailing list