Re: [PATCH net-next V2 2/5] net: lan743x: Add support to software-nodes for sfp
From: Andrew Lunn
Date: Mon Sep 16 2024 - 16:38:16 EST
> If you really want to do this kind of thing, at least write it in
> a safe way...
>
> snprintf(..., "%s", string);
>
> rather than:
>
> snprintf(..., string);
>
> so that "string" doesn't attempt to be escape-expanded.
One of the static analysers is complaining about this danger, or it
might be GCC itself if you up the warning level. The kernel hardening
people are replacing all such bad cases, one by one. So we definitely
don't want to add more.
Andrew