[PATCH RFC 2/3] powerpc/ps3: refactor strncpy usage attempt 2
Kees Cook
keescook at chromium.org
Tue Aug 15 09:13:55 AEST 2023
On Fri, Aug 11, 2023 at 09:19:20PM +0000, Justin Stitt wrote:
> This approach tries to use `make_field` inside of `make_first_field`.
> This comes with some weird implementation as to get the same result we
> need to first subtract `index` from the `make_field` result whilst being
> careful with order of operations. We then have to add index back.
I think for readability, it's better to avoid the function composition.
The index subtraction undoes the earlier addition -- I say just leave it
separate.
i.e. I like option 1 of 3 the best.
-Kees
--
Kees Cook
More information about the Linuxppc-dev
mailing list