[FFmpeg-devel] [PATCH] File concat protocol
Måns Rullgård
mans
Sun Jun 24 22:05:29 CEST 2007
Alex Beregszaszi <alex at rtfs.hu> writes:
> Hi,
>
>> >> >> + if (len == 0)
>> >> >> + break;
>> >> >> + fn = av_malloc(len+1);
>> >> >> + strncpy(fn, filename, len);
>> >> >
>> >> > shouldnt av_strlcpy() be used here?
>> >>
>> >> strncpy() certainly won't do the right thing (it rarely does).
>> >> av_strlcpy(fn, filename, len+1) should work, even though it's not the
>> >> typical use case.
>> >
>> > Why not av_strdup ?
>>
>> Because it does something else.
>
> What else?
It duplicates a null terminated string. The source string isn't null
terminated here.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list