Alexander Pyhalov
2020-07-20 873878f23d6d076740914c575565dcc4e770e139
gkrellm: fix crashes while gathering disk and battery info
1 files added
2 files modified
25 ■■■■■ changed files
components/desktop/gkrellm/Makefile 2 ●●● patch | view | raw | blame | history
components/desktop/gkrellm/patches/02-battery.patch 2 ●●● patch | view | raw | blame | history
components/desktop/gkrellm/patches/04-fix-diskinfo-crash.patch 21 ●●●●● patch | view | raw | blame | history
components/desktop/gkrellm/Makefile
@@ -16,7 +16,7 @@
COMPONENT_NAME=        gkrellm
COMPONENT_VERSION=    2.3.10
COMPONENT_REVISION=    1
COMPONENT_REVISION=    2
COMPONENT_PROJECT_URL=    http://gkrellm.srcbox.net/
COMPONENT_SUMMARY=    Popular (ubiquitous) Gtk-based system monitor
COMPONENT_SRC=        $(COMPONENT_NAME)-$(COMPONENT_VERSION)
components/desktop/gkrellm/patches/02-battery.patch
@@ -173,7 +173,7 @@
+               return ;
+           }
+
+           key = "battery.rechargeable.is_discharging"; /* the battery is being used */
+           key = g_strdup("battery.rechargeable.is_discharging"); /* the battery is being used */
+           discharging = libhal_device_get_property_bool( ctx, udi, key, &error );
+           g_free(key);
+
components/desktop/gkrellm/patches/04-fix-diskinfo-crash.patch
New file
@@ -0,0 +1,21 @@
Fixes crash in gkrellm_disk_assign_data_by_name()
--- gkrellm-2.3.10/src/sysdeps/solaris.c.~2~    2020-07-20 23:14:32.537403716 +0000
+++ gkrellm-2.3.10/src/sysdeps/solaris.c    2020-07-20 23:16:09.486411565 +0000
@@ -262,7 +262,7 @@
 static gint get_instance(gint);
 typedef struct {
-    char name[8];
+    char name[KSTAT_STRLEN];
 } probed_harddisk;
 GList *hard_disk_list;
@@ -301,6 +301,8 @@
             if(strcmp(drive->name, ksp->ks_name))
                 continue;
+            if(!isharddisk(ksp))
+                continue;
             memset((void *)&kios, 0, sizeof(kstat_io_t));
             kstat_read(kc, ksp, &kios);