commit c0decac19da3906d9b66291e57b7759489e1170f
Author: Mauro Carvalho Chehab <mchehab+sams...@kernel.org>
Date:   Mon Sep 10 08:19:14 2018 -0400

    media: use strscpy() instead of strlcpy()
The implementation of strscpy() is more robust and safer. That's now the recommended way to copy NUL terminated strings. Signed-off-by: Mauro Carvalho Chehab <mchehab+sams...@kernel.org>
    Reviewed-by: Kees Cook <keesc...@chromium.org>
    Acked-by: Hans Verkuil <hans.verk...@cisco.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+sams...@kernel.org>

Hi Mauro,

The following piece of the commit above I believe is wrong:

        if (descr)
-               WARN_ON(strlcpy(fmt->description, descr, sz) >= sz);
+               WARN_ON(strscpy(fmt->description, descr, sz) >= sz);
        fmt->flags = flags;

It should be:
                WARN_ON(strscpy(fmt->description, descr, sz) < 0);

I don't have time to make a full patch for this so please handle this issue for me. Thank you!

--HPS

Reply via email to