[Xfce4-commits] [panel-plugins/xfce4-sensors-plugin] 03/11: null-pointer checks in configuration handling
noreply at xfce.org
noreply at xfce.org
Tue Mar 7 23:38:27 CET 2017
This is an automated email from the git hooks/post-receive script.
timystery pushed a commit to branch master
in repository panel-plugins/xfce4-sensors-plugin.
commit 4171d87ffb17b7c59643629c2cd1d374f29420f0
Author: Fabian <timystery at arcor.de>
Date: Mon Mar 6 23:09:23 2017 +0100
null-pointer checks in configuration handling
---
lib/configuration.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/lib/configuration.c b/lib/configuration.c
index 1a4939a..2a48981 100644
--- a/lib/configuration.c
+++ b/lib/configuration.c
@@ -48,6 +48,8 @@ get_Id_from_address (gint idx_chip, gint addr_chipfeature, t_sensors *ptr_sensor
TRACE ("enters get_Id_from_address");
+ g_return_val_if_fail(ptr_sensors!=NULL, result);
+
ptr_chip = (t_chip *) g_ptr_array_index (ptr_sensors->chips, idx_chip);
if (ptr_chip)
@@ -82,6 +84,8 @@ sensors_write_config (t_sensors *ptr_sensors)
TRACE ("enters sensors_write_config");
+ g_return_if_fail(ptr_sensors!=NULL);
+
if ( ! (str_file = ptr_sensors->plugin_config_file) ) {
TRACE ("leaves sensors_write_config: No file location specified.");
}
@@ -207,6 +211,10 @@ sensors_read_general_config (XfceRc *ptr_xfceresources, t_sensors *ptr_sensors)
TRACE ("enters sensors_read_general_config");
+ g_return_if_fail(ptr_xfceresources!=NULL);
+
+ g_return_if_fail(ptr_sensors!=NULL);
+
if (xfce_rc_has_group (ptr_xfceresources, "General") ) {
xfce_rc_set_group (ptr_xfceresources, "General");
@@ -278,6 +286,10 @@ sensors_read_preliminary_config (XfcePanelPlugin *ptr_panelplugin, t_sensors *pt
TRACE ("enters sensors_read_preliminary_config");
+ g_return_if_fail(ptr_panelplugin!=NULL);
+
+ g_return_if_fail(ptr_sensors!=NULL);
+
if (ptr_panelplugin)
{
if ((str_file = ptr_sensors->plugin_config_file))
@@ -315,6 +327,10 @@ sensors_read_config (XfcePanelPlugin *ptr_panelplugin, t_sensors *ptr_sensors)
TRACE ("enters sensors_read_config");
+ g_return_if_fail(ptr_panelplugin!=NULL);
+
+ g_return_if_fail(ptr_sensors!=NULL);
+
if (!(str_file = ptr_sensors->plugin_config_file))
return;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list