[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/11] Paper over a stringop-overflow warning about wide char han
From: |
Robbie Harwood |
Subject: |
[PATCH 10/11] Paper over a stringop-overflow warning about wide char handling |
Date: |
Mon, 25 Oct 2021 17:55:43 -0400 |
From: Peter Jones <pjones@redhat.com>
[rharwood@redhat.com: rewrote commit message]
Signed-off-by: Robbie Harwood <rharwood@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
- [PATCH 07/11] Make CFLAGS less painful, (continued)
- [PATCH 07/11] Make CFLAGS less painful, Robbie Harwood, 2021/10/25
- [PATCH 02/11] argp-parse.c (__argp_input): Don't crash if pstate is NULL, Robbie Harwood, 2021/10/25
- [PATCH 05/11] Fix width computation, Robbie Harwood, 2021/10/25
- [PATCH 01/11] Fix base64 module to work with grub codebase, Robbie Harwood, 2021/10/25
- [PATCH 06/11] Make gnulib's regcomp not abort(), Robbie Harwood, 2021/10/25
- [PATCH 03/11] gnulib/regexec: Fix possible null-dereference, Robbie Harwood, 2021/10/25
- [PATCH 11/11] Fixup for -Werror=ignored-qualifiers issues, Robbie Harwood, 2021/10/25
- [PATCH 04/11] gnulib/regexec: Resolve unused variable, Robbie Harwood, 2021/10/25
- [PATCH 09/11] Fix up a bunch of "gcc -Werror=sign-compare" complaints, Robbie Harwood, 2021/10/25
- [PATCH 10/11] Paper over a stringop-overflow warning about wide char handling,
Robbie Harwood <=