Re: [PATCH v2] kobject: Replace strlcpy with strscpy
From: Azeem Shaikh
Date: Wed Aug 30 2023 - 15:23:48 EST
> - len = strlcpy(&env->buf[env->buflen], subsystem, buffer_size);
> - if (len >= buffer_size) {
> - pr_warn("init_uevent_argv: buffer size of %d too small, needed %d\n",
> - buffer_size, len);
> + len = strscpy(&env->buf[env->buflen], subsystem, buffer_size);
> + if (len < 0) {
> + pr_warn("init_uevent_argv: insufficient buffer space "
> + "(%u left) for %s\n", buffer_size, subsystem);
Please ignore this patch. There's some weird indentation that I
noticed here that I'll fix in v3.