evolution r34768 - in trunk: addressbook addressbook/tools plugins/backup-restore plugins/google-account-setup



Author: msuman
Date: Sun Jan  6 16:43:58 2008
New Revision: 34768
URL: http://svn.gnome.org/viewvc/evolution?rev=34768&view=rev

Log:
Patch from Christian Krause  <chkr plauener de>: Fix for bug #506772 (Not-NULL check for a string array before finding its length), handle NULL filename strings before backup/restore/check operations in the backup-restore plugin.

Modified:
   trunk/addressbook/ChangeLog
   trunk/addressbook/tools/evolution-addressbook-export.c
   trunk/plugins/backup-restore/ChangeLog
   trunk/plugins/backup-restore/backup.c
   trunk/plugins/google-account-setup/ChangeLog

Modified: trunk/addressbook/ChangeLog
==============================================================================
--- trunk/addressbook/ChangeLog	(original)
+++ trunk/addressbook/ChangeLog	Sun Jan  6 16:43:58 2008
@@ -1,3 +1,10 @@
+2008-01-06  Christian Krause  <chkr plauener de>
+
+	** Fix for bug #506772
+
+	* tools/evolution-addressbook-export.c: (main): Not-NULL check for a 
+	string array before finding its length. 
+
 2007-12-11  Sankar P  <psankar novell com>
 
 	** Fix for bug #501969

Modified: trunk/addressbook/tools/evolution-addressbook-export.c
==============================================================================
--- trunk/addressbook/tools/evolution-addressbook-export.c	(original)
+++ trunk/addressbook/tools/evolution-addressbook-export.c	Sun Jan  6 16:43:58 2008
@@ -92,7 +92,7 @@
 		GNOME_PARAM_NONE);
 
 	/* Parsing Parameter */
-	if (g_strv_length (opt_remaining) > 0)
+	if (opt_remaining && g_strv_length (opt_remaining) > 0)
 		opt_addressbook_folder_uri = g_strdup (opt_remaining[0]);
 
 	if (opt_list_folders_mode != FALSE) {

Modified: trunk/plugins/backup-restore/ChangeLog
==============================================================================
--- trunk/plugins/backup-restore/ChangeLog	(original)
+++ trunk/plugins/backup-restore/ChangeLog	Sun Jan  6 16:43:58 2008
@@ -1,3 +1,9 @@
+2008-01-06  Christian Krause  <chkr plauener de>
+
+	* backup.c: (backup), (restore), (check), (main): Initialize static 
+	variables before use, not-NULL checks for filename before
+	backup/restore/check operations. 
+
 2007-08-07  Johnny Jacob  <jjohnny novell com>
 	
 	* Committed on behalf of Anand V M   <avmuttagi gmail com>

Modified: trunk/plugins/backup-restore/backup.c
==============================================================================
--- trunk/plugins/backup-restore/backup.c	(original)
+++ trunk/plugins/backup-restore/backup.c	Sun Jan  6 16:43:58 2008
@@ -21,11 +21,11 @@
 #define ARCHIVE_NAME "evolution-backup.tar.gz"
 
 static gboolean backup_op = FALSE;
-static char *bk_file;
+static char *bk_file = NULL;
 static gboolean restore_op = FALSE;
-static char *res_file;
+static char *res_file = NULL;
 static gboolean check_op = FALSE;
-static char *chk_file;
+static char *chk_file = NULL;
 static gboolean restart_arg = FALSE;
 static gboolean gui_arg = FALSE;
 static gchar **opt_remaining = NULL;
@@ -63,6 +63,8 @@
 {
 	char *command;
 
+	g_return_if_fail (filename && *filename);
+
 	CANCEL (complete);
 	txt = _("Shutting down Evolution");
 	/* FIXME Will the versioned setting always work? */
@@ -72,7 +74,6 @@
 	txt = _("Backing Evolution accounts and settings");
 	s ("gconftool-2 --dump " GCONF_DIR " > " GCONF_DUMP_PATH);
 
-
 	CANCEL (complete);
 	txt = _("Backing Evolution data (Mails, Contacts, Calendar, Tasks, Memos)");
 
@@ -102,6 +103,8 @@
 {
 	char *command;
 
+	g_return_if_fail (filename && *filename);
+
 	/* FIXME Will the versioned setting always work? */
 	CANCEL (complete);
 	txt = _("Shutting down Evolution");
@@ -142,6 +145,8 @@
 {
 	char *command;
 
+	g_return_if_fail (filename && *filename);
+
 	command = g_strdup_printf ("tar ztf %s | grep -e \"^\\.evolution/$\"", filename);
 	result = system (command);
 	g_free (command);
@@ -238,21 +243,22 @@
 				      GNOME_PARAM_GOPTION_CONTEXT, context,
 				      GNOME_PARAM_NONE);
 
-
-	for (i = 0; i < g_strv_length (opt_remaining); i++) {
-		if (backup_op) {
-			oper = _("Backing up to the folder %s");
-			d(g_message ("Backing up to the folder %s", (char *) opt_remaining[i]));
-			bk_file = g_strdup ((char *) opt_remaining[i]);
-			file = bk_file;
-		} else if (restore_op) {
-			oper = _("Restoring from the folder %s");
-			d(g_message ("Restoring from the folder %s", (char *) opt_remaining[i]));
-			res_file = g_strdup ((char *) opt_remaining[i]);
-			file = res_file;
-		} else if (check_op) {
-			d(g_message ("Checking %s", (char *) opt_remaining[i]));
-			chk_file = g_strdup ((char *) opt_remaining[i]);
+	if (opt_remaining) {
+		for (i = 0; i < g_strv_length (opt_remaining); i++) {
+			if (backup_op) {
+				oper = _("Backing up to the folder %s");
+				d(g_message ("Backing up to the folder %s", (char *) opt_remaining[i]));
+				bk_file = g_strdup ((char *) opt_remaining[i]);
+				file = bk_file;
+			} else if (restore_op) {
+				oper = _("Restoring from the folder %s");
+				d(g_message ("Restoring from the folder %s", (char *) opt_remaining[i]));
+				res_file = g_strdup ((char *) opt_remaining[i]);
+				file = res_file;
+			} else if (check_op) {
+				d(g_message ("Checking %s", (char *) opt_remaining[i]));
+				chk_file = g_strdup ((char *) opt_remaining[i]);
+			}
 		}
 	}
 
@@ -267,6 +273,7 @@
                         	                          GTK_STOCK_CANCEL,
                                 	                  GTK_RESPONSE_REJECT,
                                         	          NULL);
+
 		if (oper && file)
 			str = g_strdup_printf(oper, file);
 
@@ -282,8 +289,6 @@
 		pbar = gtk_progress_bar_new ();
 		gtk_box_pack_start ((GtkBox *)hbox, pbar, TRUE, TRUE, 6);
 
-
-
 		gtk_box_pack_start ((GtkBox *)vbox, hbox, FALSE, FALSE, 0);
 
 		gtk_container_add (GTK_CONTAINER (GTK_DIALOG(progress_dialog)->vbox), vbox);

Modified: trunk/plugins/google-account-setup/ChangeLog
==============================================================================
--- trunk/plugins/google-account-setup/ChangeLog	(original)
+++ trunk/plugins/google-account-setup/ChangeLog	Sun Jan  6 16:43:58 2008
@@ -1,4 +1,4 @@
-2007-12-23  Nyall  <nyall zombiepigs net>
+2007-12-23  Nyall Dawson <nyall zombiepigs net>
 
 	** Fix for bug #503954
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]