]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - lib/string.c
Merge tag 'asoc-v5.5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[linux.git] / lib / string.c
index f7bc10da4259f14512631a637fb09b9b98257d97..cd7a10c192109967ebefb4f123a4cf5f9c7b4e3a 100644 (file)
@@ -183,7 +183,7 @@ ssize_t strscpy(char *dest, const char *src, size_t count)
        size_t max = count;
        long res = 0;
 
-       if (count == 0)
+       if (count == 0 || WARN_ON_ONCE(count > INT_MAX))
                return -E2BIG;
 
 #ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS