From 100de32cff012e980109ebbefba2c938775eddac Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 22 Jan 2021 13:56:04 -0500 Subject: [PATCH] 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'; }