[FFmpeg-devel] [PATCH] forbid strcpy

Måns Rullgård mans
Sat Jan 30 20:18:16 CET 2010


"Ronald S. Bultje" <rsbultje at gmail.com> writes:

> Hi,
>
> On Jan 30, 2010, at 12:59 PM, Reimar D?ffinger
> <Reimar.Doeffinger at gmx.de> wrote:
>> On Sat, Jan 30, 2010 at 11:02:34AM -0500, Ronald S. Bultje wrote:
>>>
>>> On Jan 30, 2010, at 10:34 AM, Reimar D?ffinger
>>> <Reimar.Doeffinger at gmx.de> wrote:
>>>> this will cause a lot of build failures, so can't be applied as
>>>> is, but
>>>> please all maintainers: either remove any strcpy uses from your
>>>> copy or
>>>> complain now, or I take the freedom to modify your code without
>>>> asking.
>>>
>>> This is not ok, strcpy() is fine and faster in a lot of places where
>>> we copy between internal buffers. There is nothing wrong with that.
>>
>> Please show me a single use where we'd notice if it was 20 times
>> faster.
>> I find it unlikely that there are cases where speed matters and
>> strcpy would be acceptable, it certainly is not particularly fast.
>
> I agree it won't make much of a difference, just expressing my feeling
> that we're entering a gray area.

Given the potential consequences of a badly applied strcpy(), it think
it's reasonable to ban it for general use.  If it really matters in
some specific case, it can be double-checked and allowed there.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list