|
1
|
+From 9b74dc16d852a40d37f7ce6c236406959fd013e5 Mon Sep 17 00:00:00 2001
|
|
2
|
+From: lukefromdc <lukefromdc@hushmail.com>
|
|
3
|
+Date: Mon, 13 Jan 2025 22:39:13 -0500
|
|
4
|
+Subject: [PATCH] Fix an invalid pointer crash with glib 2.83.2
|
|
5
|
+
|
|
6
|
+The typecast to non-const gchar produced invalid pointer errors on free() with glib 2.83.2
|
|
7
|
+---
|
|
8
|
+ plugins/udisks2/udisks2-plugin.c | 19 +++++--------------
|
|
9
|
+ 1 file changed, 5 insertions(+), 14 deletions(-)
|
|
10
|
+
|
|
11
|
+Index: mate-sensors-applet-1.26.0/plugins/udisks2/udisks2-plugin.c
|
|
12
|
+===================================================================
|
|
13
|
+--- mate-sensors-applet-1.26.0.orig/plugins/udisks2/udisks2-plugin.c
|
|
14
|
++++ mate-sensors-applet-1.26.0/plugins/udisks2/udisks2-plugin.c
|
|
15
|
+@@ -311,16 +311,15 @@ syslog(LOG_ERR, "propdict2 type: %s", g_
|
|
16
|
+ #endif
|
|
17
|
+
|
|
18
|
+ /* get data */
|
|
19
|
+- gchar *id = NULL;
|
|
20
|
+- gchar *model = NULL;
|
|
21
|
++ const gchar *id = NULL;
|
|
22
|
++ const gchar *model = NULL;
|
|
23
|
+
|
|
24
|
+ gboolean smartenabled;
|
|
25
|
+ gdouble temp;
|
|
26
|
+
|
|
27
|
+- /* NULL, bc we don't care about the length of the string
|
|
28
|
+- * typecast bc g_variant_get_string() returns const char* */
|
|
29
|
+- id = (gchar *) g_variant_get_string (g_variant_lookup_value (propdict, "Id", G_VARIANT_TYPE_STRING), NULL);
|
|
30
|
+- model = (gchar *) g_variant_get_string (g_variant_lookup_value (propdict, "Model", G_VARIANT_TYPE_STRING), NULL);
|
|
31
|
++ /* NULL, bc we don't care about the length of the string*/
|
|
32
|
++ id = g_variant_get_string (g_variant_lookup_value (propdict, "Id", G_VARIANT_TYPE_STRING), NULL);
|
|
33
|
++ model = g_variant_get_string (g_variant_lookup_value (propdict, "Model", G_VARIANT_TYPE_STRING), NULL);
|
|
34
|
+
|
|
35
|
+ smartenabled = g_variant_get_boolean (g_variant_lookup_value (propdict2, "SmartEnabled", G_VARIANT_TYPE_BOOLEAN));
|
|
36
|
+ temp = g_variant_get_double (g_variant_lookup_value (propdict2, "SmartTemperature", G_VARIANT_TYPE_DOUBLE));
|
|
37
|
+@@ -373,14 +372,6 @@ syslog(LOG_ERR, "No temp data for device
|
|
38
|
+
|
|
39
|
+ g_debug ("No temp data for device: %s\n", key);
|
|
40
|
+ }
|
|
41
|
+-
|
|
42
|
+-#ifdef UD2PD
|
|
43
|
+-syslog(LOG_ERR, "b4 free1");
|
|
44
|
+-#endif
|
|
45
|
+-
|
|
46
|
+- g_free (id);
|
|
47
|
+- g_free (model);
|
|
48
|
+-
|
|
49
|
+ }
|
|
50
|
+
|
|
51
|
+ #ifdef UD2PD |