hal: Branch 'master'

Holger Macht homac at kemper.freedesktop.org
Tue Feb 20 01:14:18 PST 2007


 hald/linux/addons/addon-cpufreq.c |    3 +++
 1 files changed, 3 insertions(+)

New commits:
diff-tree b482f32816004c50cb5e1390fe1a21b43b3392ed (from e30c3d6de8da910f2547c5c12b1cbb3dfe99261d)
Author: Martin Pitt <martin at piware.de>
Date:   Tue Feb 20 10:12:46 2007 +0100

    fix crash because of missing return value check
    
    read_line_str_split() sometimes returns NULL, and the following for loop
    just accesses the return value as an array without checking for NULL.
    Backtrace can be found here: https://launchpad.net/bugs/85717

diff --git a/hald/linux/addons/addon-cpufreq.c b/hald/linux/addons/addon-cpufreq.c
index 1fd6aa4..1a167a3 100644
--- a/hald/linux/addons/addon-cpufreq.c
+++ b/hald/linux/addons/addon-cpufreq.c
@@ -186,6 +186,9 @@ gboolean read_line_int_split(char *filen
 
 	l = read_line_str_split(filename, delim);
 
+        if (l == NULL)
+                return FALSE;
+	
 	for (i = 0; l[i] != NULL; i++) {
 		int value = atoi(l[i]);
 		*list = g_slist_append(*list, GINT_TO_POINTER(value));


More information about the hal-commit mailing list