Patch-Source: https://gitlab.gnome.org/GNOME/gtk/-/commit/6dc75b46cc9afe1c98b7ba72a9b1a275c723ea42 -- From 6dc75b46cc9afe1c98b7ba72a9b1a275c723ea42 Mon Sep 17 00:00:00 2001 From: liiulinsong Date: Fri, 26 May 2023 10:18:58 +0800 Subject: [PATCH] Make sure that the charcode is signless 1. The data with type of char is signed by default. 2. The byte value of UTF-8 is signless by default. 3. So, if a UTF-8 charcode is stored in a char array, we should cast the type of its value from char to unsigned char. --- gtk/gtkcssparser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkcssparser.c b/gtk/gtkcssparser.c index 44ff7bcfca7..fc8ede28b88 100644 --- a/gtk/gtkcssparser.c +++ b/gtk/gtkcssparser.c @@ -373,7 +373,7 @@ _gtk_css_parser_read_char (GtkCssParser *parser, parser->data++; return TRUE; } - if (*parser->data >= 127) + if ((*(guchar *) parser->data) >= 127) { gsize len = g_utf8_skip[(guint) *(guchar *) parser->data]; -- GitLab