[gtk/lsan-leaks-2] Avoid a buffer overrun
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/lsan-leaks-2] Avoid a buffer overrun
- Date: Fri, 22 Jan 2021 18:56:50 +0000 (UTC)
commit 0ef91c3ba83bdf037556810520b7cb3a49803d50
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jan 22 13:56:04 2021 -0500
Avoid a buffer overrun
We were putting the '\0' behind the end. Oops.
gtk/language-names.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gtk/language-names.c b/gtk/language-names.c
index 087f86b922..16deef3bea 100644
--- a/gtk/language-names.c
+++ b/gtk/language-names.c
@@ -164,7 +164,7 @@ languages_parse_start_tag (GMarkupParseContext *ctx,
for (i = 0; i < G_N_ELEMENTS (long_names); i++)
{
if (g_str_has_prefix (display_name, long_names[i]))
- display_name[strlen (long_names[i]) + 1] = '\0';
+ display_name[strlen (long_names[i])] = '\0';
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]