Re: [PATCH] soc: qcom: cmd-db: replace deprecated strncpy with memcpy

2024-03-18 Thread Kees Cook
On Mon, Mar 18, 2024 at 03:47:38PM -0700, Justin Stitt wrote: > Gotcha, I was operating under the assumption that we needed to know > the size of id at compile time. Apparently __builtin_object_size(_, 1) > will return SIZE_T_MAX if we don't know the size of something. Sending > a v2. Yeah, it onl

Re: [PATCH] soc: qcom: cmd-db: replace deprecated strncpy with memcpy

2024-03-18 Thread Justin Stitt
On Mon, Mar 18, 2024 at 2:52 PM Kees Cook wrote: > > On Thu, Mar 14, 2024 at 10:29:37PM +, Justin Stitt wrote: > > strncpy() is deprecated for use on NUL-terminated destination strings > > [1] and as such we should prefer more robust and less ambiguous string > > interfaces. > > > > @query is

Re: [PATCH] soc: qcom: cmd-db: replace deprecated strncpy with memcpy

2024-03-18 Thread Kees Cook
On Thu, Mar 14, 2024 at 10:29:37PM +, Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > @query is already marked as __nonstring and doesn't need to be > NUL-term

[PATCH] soc: qcom: cmd-db: replace deprecated strncpy with memcpy

2024-03-14 Thread Justin Stitt
strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. @query is already marked as __nonstring and doesn't need to be NUL-terminated. Due to this, we don't need to use a string API here (especially a