[Xfce4-commits] <orage:master> 4.5.7.17: Fix crash in BUG 6290

Juha Kautto noreply at xfce.org
Thu Mar 11 10:38:01 CET 2010


Updating branch refs/heads/master
         to 51bc004878b82ea625e8955bf614455c894e4c86 (commit)
       from 31488e50165672aa520e9566cbac7ca87a13c486 (commit)

commit 51bc004878b82ea625e8955bf614455c894e4c86
Author: Juha Kautto <juha at xfce.org>
Date:   Thu Mar 11 11:35:10 2010 +0200

    4.5.7.17: Fix crash in BUG 6290
    
    Crash part of that BUG is fixed. Still can't reproduce the garbage.

 configure.in.in                 |    2 +-
 globaltime/tz_zoneinfo_read.c   |    8 +++++---
 panel-plugin/tz_zoneinfo_read.c |    8 +++++---
 src/tz_zoneinfo_read.c          |    8 +++++---
 4 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index 46c3ecf..1d60511 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -9,7 +9,7 @@ dnl Written for Xfce by Juha Kautto <juha at xfce.org>
 dnl
 
 dnl Version information
-m4_define([orage_version], [4.7.5.16-git])
+m4_define([orage_version], [4.7.5.17-git])
 
 m4_define([gtk_minimum_version], [2.10.0])
 m4_define([xfce_minimum_version], [4.6.0])
diff --git a/globaltime/tz_zoneinfo_read.c b/globaltime/tz_zoneinfo_read.c
index d7cd2fb..d029177 100644
--- a/globaltime/tz_zoneinfo_read.c
+++ b/globaltime/tz_zoneinfo_read.c
@@ -603,6 +603,7 @@ static int check_parameters()
     if (debug > 1)
         printf("check_parameters: start\n");
 
+    in_file = NULL;
     par_file = fopen(TZ_CONVERT_PAR_FILE_LOC, "r");
     if (par_file != NULL) { /* does exist and no error */
         if (stat(TZ_CONVERT_PAR_FILE_LOC, &par_file_stat) == -1) {
@@ -618,6 +619,7 @@ static int check_parameters()
                 printf("check_parameters: error reading (%s)\n"
                         , TZ_CONVERT_PAR_FILE_LOC);
                 free(in_file);
+                in_file = NULL;
                 fclose(par_file);
             }
             else { 
@@ -882,9 +884,6 @@ orage_timezone_array get_orage_timezones(int show_details, int ical)
         tz_array.next_utc_offset = (int *)malloc(sizeof(int)*(tz_array_size+2));
         tz_array.country = (char **)malloc(sizeof(char *)*(tz_array_size+2));
         tz_array.cc = (char **)malloc(sizeof(char *)*(tz_array_size+2));
-    /* nftw goes through the whole file structure and calls "file_call"
-     * with each file. It returns 0 when everything has been done and -1
-     * if it run into an error. */
         check_parameters();
         if (debug > 0)
             printf("Processing %s files\n", in_file);
@@ -899,6 +898,9 @@ orage_timezone_array get_orage_timezones(int show_details, int ical)
             read_ical_timezones();
 #endif
         }
+    /* nftw goes through the whole file structure and calls "file_call"
+     * with each file. It returns 0 when everything has been done and -1
+     * if it run into an error. */
         if (nftw(in_file, file_call, 10, FTW_PHYS | FTW_ACTIONRETVAL) == -1) {
             perror("nftw error in file handling");
             exit(EXIT_FAILURE);
diff --git a/panel-plugin/tz_zoneinfo_read.c b/panel-plugin/tz_zoneinfo_read.c
index d7cd2fb..d029177 100644
--- a/panel-plugin/tz_zoneinfo_read.c
+++ b/panel-plugin/tz_zoneinfo_read.c
@@ -603,6 +603,7 @@ static int check_parameters()
     if (debug > 1)
         printf("check_parameters: start\n");
 
+    in_file = NULL;
     par_file = fopen(TZ_CONVERT_PAR_FILE_LOC, "r");
     if (par_file != NULL) { /* does exist and no error */
         if (stat(TZ_CONVERT_PAR_FILE_LOC, &par_file_stat) == -1) {
@@ -618,6 +619,7 @@ static int check_parameters()
                 printf("check_parameters: error reading (%s)\n"
                         , TZ_CONVERT_PAR_FILE_LOC);
                 free(in_file);
+                in_file = NULL;
                 fclose(par_file);
             }
             else { 
@@ -882,9 +884,6 @@ orage_timezone_array get_orage_timezones(int show_details, int ical)
         tz_array.next_utc_offset = (int *)malloc(sizeof(int)*(tz_array_size+2));
         tz_array.country = (char **)malloc(sizeof(char *)*(tz_array_size+2));
         tz_array.cc = (char **)malloc(sizeof(char *)*(tz_array_size+2));
-    /* nftw goes through the whole file structure and calls "file_call"
-     * with each file. It returns 0 when everything has been done and -1
-     * if it run into an error. */
         check_parameters();
         if (debug > 0)
             printf("Processing %s files\n", in_file);
@@ -899,6 +898,9 @@ orage_timezone_array get_orage_timezones(int show_details, int ical)
             read_ical_timezones();
 #endif
         }
+    /* nftw goes through the whole file structure and calls "file_call"
+     * with each file. It returns 0 when everything has been done and -1
+     * if it run into an error. */
         if (nftw(in_file, file_call, 10, FTW_PHYS | FTW_ACTIONRETVAL) == -1) {
             perror("nftw error in file handling");
             exit(EXIT_FAILURE);
diff --git a/src/tz_zoneinfo_read.c b/src/tz_zoneinfo_read.c
index d7cd2fb..d029177 100644
--- a/src/tz_zoneinfo_read.c
+++ b/src/tz_zoneinfo_read.c
@@ -603,6 +603,7 @@ static int check_parameters()
     if (debug > 1)
         printf("check_parameters: start\n");
 
+    in_file = NULL;
     par_file = fopen(TZ_CONVERT_PAR_FILE_LOC, "r");
     if (par_file != NULL) { /* does exist and no error */
         if (stat(TZ_CONVERT_PAR_FILE_LOC, &par_file_stat) == -1) {
@@ -618,6 +619,7 @@ static int check_parameters()
                 printf("check_parameters: error reading (%s)\n"
                         , TZ_CONVERT_PAR_FILE_LOC);
                 free(in_file);
+                in_file = NULL;
                 fclose(par_file);
             }
             else { 
@@ -882,9 +884,6 @@ orage_timezone_array get_orage_timezones(int show_details, int ical)
         tz_array.next_utc_offset = (int *)malloc(sizeof(int)*(tz_array_size+2));
         tz_array.country = (char **)malloc(sizeof(char *)*(tz_array_size+2));
         tz_array.cc = (char **)malloc(sizeof(char *)*(tz_array_size+2));
-    /* nftw goes through the whole file structure and calls "file_call"
-     * with each file. It returns 0 when everything has been done and -1
-     * if it run into an error. */
         check_parameters();
         if (debug > 0)
             printf("Processing %s files\n", in_file);
@@ -899,6 +898,9 @@ orage_timezone_array get_orage_timezones(int show_details, int ical)
             read_ical_timezones();
 #endif
         }
+    /* nftw goes through the whole file structure and calls "file_call"
+     * with each file. It returns 0 when everything has been done and -1
+     * if it run into an error. */
         if (nftw(in_file, file_call, 10, FTW_PHYS | FTW_ACTIONRETVAL) == -1) {
             perror("nftw error in file handling");
             exit(EXIT_FAILURE);



More information about the Xfce4-commits mailing list