lkml.org 
[lkml]   [2024]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3 4/4] um: Convert strscpy() usage to 2-argument style
On Tue, Feb 6, 2024 at 4:22 PM Kees Cook <keescook@chromium.org> wrote:
>
> The ARCH=um build has its own idea about strscpy()'s definition. Adjust
> the callers to remove the redundant sizeof() arguments ahead of treewide
> changes, since it needs a manual adjustment for the newly named
> sized_strscpy() export.

..

> - strscpy(dir, home, sizeof(dir));
> + strscpy(dir, home);
> uml_dir++;
> }
> strlcat(dir, uml_dir, sizeof(dir));

An (unrelated) side note: are we going to get rid of strlcat() as well
(after strlcpy() is gone)?

..

> if (*umid == '\0') {
> - strscpy(tmp, uml_dir, sizeof(tmp));
> + strscpy(tmp, uml_dir);
> strlcat(tmp, "XXXXXX", sizeof(tmp));

This code is interesting... (Esp. taking into account making a
temporary folder out of this...)

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2024-05-27 14:50    [W:0.363 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site