diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-01-02 08:46:35 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-01-02 08:46:35 -0500 |
| commit | b6a09416e83ffe4eccfb4ef1b91b3b66483fa810 (patch) | |
| tree | b30f266e85047244dcdb47d5afc134e76aec530d /include/linux/string.h | |
| parent | db809859c8cee415293b830e67178f526d1eb2be (diff) | |
| parent | 30a7acd573899fd8b8ac39236eff6468b195ac7d (diff) | |
Merge 4.15-rc6 into char-misc-next
We want the fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/string.h')
| -rw-r--r-- | include/linux/string.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/string.h b/include/linux/string.h index 410ecf17de3c..cfd83eb2f926 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
| @@ -259,7 +259,10 @@ __FORTIFY_INLINE __kernel_size_t strlen(const char *p) | |||
| 259 | { | 259 | { |
| 260 | __kernel_size_t ret; | 260 | __kernel_size_t ret; |
| 261 | size_t p_size = __builtin_object_size(p, 0); | 261 | size_t p_size = __builtin_object_size(p, 0); |
| 262 | if (p_size == (size_t)-1) | 262 | |
| 263 | /* Work around gcc excess stack consumption issue */ | ||
| 264 | if (p_size == (size_t)-1 || | ||
| 265 | (__builtin_constant_p(p[p_size - 1]) && p[p_size - 1] == '\0')) | ||
| 263 | return __builtin_strlen(p); | 266 | return __builtin_strlen(p); |
| 264 | ret = strnlen(p, p_size); | 267 | ret = strnlen(p, p_size); |
| 265 | if (p_size <= ret) | 268 | if (p_size <= ret) |
