From: Peter Jones <[email protected]>
[[email protected]: rewrote commit message]
Signed-off-by: Robbie Harwood <[email protected]>
---
lib/vasnprintf.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
index 485745243f..122b224259 100644
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -234,8 +234,11 @@
static size_t
local_strnlen (const char *string, size_t maxlen)
{
+#pragma GCC diagnostic push
+#pragma GCC diagnostic warning "-Wstringop-overflow"
const char *end = memchr (string, '\0', maxlen);
return end ? (size_t) (end - string) : maxlen;
+#pragma GCC diagnostic pop
}
# endif
# endif
--
2.34.1