Avoid overflow in pgtk_is_numeric_char
authorStefan Kangas <stefankangas@gmail.com>
Thu, 18 Jul 2024 07:34:22 +0000 (09:34 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Thu, 18 Jul 2024 07:42:07 +0000 (09:42 +0200)
* src/pgtkfns.c (parse_resource_key): Avoid overflow by making array
larger, if a key is RESOURCE_KEY_MAX_LEN long.  Do not merge to master,
since it's fixed in a different way there.

src/pgtkfns.c

index 49467988cae26111e950810067c7d99de2fe3686..085c41eb759fe36decb276f58f1189a261c7f71c 100644 (file)
@@ -1803,7 +1803,7 @@ pgtk_is_numeric_char (int c)
 static GSettings *
 parse_resource_key (const char *res_key, char *setting_key)
 {
-  char path[32 + RESOURCE_KEY_MAX_LEN];
+  char path[33 + RESOURCE_KEY_MAX_LEN];
   const char *sp = res_key;
   char *dp;