From: Peter Jones <pjo...@redhat.com>

[rharw...@redhat.com: rewrote commit message]
Signed-off-by: Robbie Harwood <rharw...@redhat.com>
---
 lib/vasnprintf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
index 360ca6948..7faa11753 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.33.0


Reply via email to