[Swan-dev] avoid strncpy : Discouraged or forbidden C functions

Andrew Cagney andrew.cagney at gmail.com
Wed Aug 16 17:16:44 UTC 2017


strlcpy()

On 16 August 2017 at 13:11, Paul Wouters <paul at nohats.ca> wrote:
> On Wed, 16 Aug 2017, Antony Antony wrote:
>
>> "Discouraged or forbidden C functions"
>> https://libreswan.org/wiki/Discouraged_or_forbidden_C_functions
>>
>> The new ones are coming in faster than Hugh (occasionally and I) can fix:)
>> Here is an example fix of fix:)
>
>
> I've fixed a few as well in the past and now :P
>
> The problem with these ones is that I'm not sure if these are really
> null terminated strings, since some of this goes into the kernel via
> netlink. So I avoided using jamstr() which assumes null terminated
> strings.
>
> But I'm happy to override strcpy() into something guaranteeing a compile
> failure :)
>
> Paul
>
> _______________________________________________
> Swan-dev mailing list
> Swan-dev at lists.libreswan.org
> https://lists.libreswan.org/mailman/listinfo/swan-dev


More information about the Swan-dev mailing list