planner r955 - in trunk: . libplanner src



Author: mvdpot
Date: Tue Apr  7 18:21:05 2009
New Revision: 955
URL: http://svn.gnome.org/viewvc/planner?rev=955&view=rev

Log:
2009-04-07  Maurice van der Pot  <griffon26 kfk4ever com>

	* README: Fixed typo.

	* libplanner/mrp-old-xml.c (old_xml_read_project):
	Fixed possible NULL pointer dereference (bug #334116).

	* src/planner-project-properties.c (mpp_property_value_data_func),
	(mpp_project_property_get_value_string):
	* src/planner-resource-view.c (resource_view_property_data_func):
	* src/planner-task-tree.c (task_tree_property_data_func):
	Fixed use of uninitialized variables (bug #334113).



Modified:
   trunk/ChangeLog
   trunk/README
   trunk/libplanner/mrp-old-xml.c
   trunk/src/planner-format.c
   trunk/src/planner-project-properties.c
   trunk/src/planner-resource-view.c
   trunk/src/planner-task-tree.c

Modified: trunk/README
==============================================================================
--- trunk/README	(original)
+++ trunk/README	Tue Apr  7 18:21:05 2009
@@ -1,7 +1,7 @@
 About Planner
 =============
 
-Planner is a project managment tool for the Gnome desktop, for planning, 
+Planner is a project management tool for the Gnome desktop, for planning, 
 scheduling and tracking projects. 
 
 Planner was originally developed and maintained by the guys at Imendio, but

Modified: trunk/libplanner/mrp-old-xml.c
==============================================================================
--- trunk/libplanner/mrp-old-xml.c	(original)
+++ trunk/libplanner/mrp-old-xml.c	Tue Apr  7 18:21:05 2009
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nill; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * Copyright (C) 2004-2005 Imendio AB
  * Copyright (C) 2002-2003 CodeFactory AB
@@ -1016,9 +1016,11 @@
 				     GINT_TO_POINTER (MRP_DAY_USE_BASE),
 				     mrp_day_ref (mrp_day_get_use_base ()));
 		
-		/* Read day-types */
-		for (day = child->children; day; day = day->next) {
-			old_xml_read_day_type (parser, day);
+		if (child != NULL) {
+		        /* Read day-types */
+        		for (day = child->children; day; day = day->next) {
+        			old_xml_read_day_type (parser, day);
+        		}
 		}
 		
 		for (child = calendars->children; child; child = child->next) {

Modified: trunk/src/planner-format.c
==============================================================================
--- trunk/src/planner-format.c	(original)
+++ trunk/src/planner-format.c	Tue Apr  7 18:21:05 2009
@@ -145,24 +145,24 @@
 	days = duration / day_length;
 	duration -= days * day_length;
 	hours = duration / (60*60);
-  duration -= hours * (60*60);
-  minutes = duration / 60;
+	duration -= hours * (60*60);
+	minutes = duration / 60;
 
 	if (days > 0) {
-    if (hours > 0) {
-      return g_strdup_printf (_("%dd %dh"), days, hours);
-    }
-    else {
-      return g_strdup_printf (_("%dd"), days);
-    }
+		if (hours > 0) {
+			return g_strdup_printf (_("%dd %dh"), days, hours);
+		}
+		else {
+			return g_strdup_printf (_("%dd"), days);
+		}
 	}
 	else if (hours > 0) {
-    if (minutes > 0) {
-      return g_strdup_printf (_("%dh %dmin"), hours, minutes);
-    }
-    else {
-      return g_strdup_printf (_("%dh"), hours);
-    }
+		if (minutes > 0) {
+			return g_strdup_printf (_("%dh %dmin"), hours, minutes);
+		}
+		else {
+			return g_strdup_printf (_("%dh"), hours);
+		}
 	}
 	else if (minutes > 0) {
 		return g_strdup_printf (_("%dmin"), minutes);

Modified: trunk/src/planner-project-properties.c
==============================================================================
--- trunk/src/planner-project-properties.c	(original)
+++ trunk/src/planner-project-properties.c	Tue Apr  7 18:21:05 2009
@@ -1086,6 +1086,7 @@
 				
 	default:
 		g_warning ("Type not implemented.");
+		svalue = g_strdup ("");
 		break;
 	}
 
@@ -1772,6 +1773,7 @@
 				
 	default:
 		g_warning ("Property type not implemented.");
+		svalue = g_strdup ("");
 		break;
 	}
 	return ((const char *) svalue);

Modified: trunk/src/planner-resource-view.c
==============================================================================
--- trunk/src/planner-resource-view.c	(original)
+++ trunk/src/planner-resource-view.c	Tue Apr  7 18:21:05 2009
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nill; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * Copyright (C) 2003-2005 Imendio AB
  * Copyright (C) 2002      CodeFactory AB
@@ -2362,6 +2362,7 @@
 				
 	default:
 		g_warning ("Type not implemented.");
+		svalue = g_strdup ("");
 		break;
 	}
 

Modified: trunk/src/planner-task-tree.c
==============================================================================
--- trunk/src/planner-task-tree.c	(original)
+++ trunk/src/planner-task-tree.c	Tue Apr  7 18:21:05 2009
@@ -2037,6 +2037,7 @@
 				
 	default:
 		g_warning ("Type not implemented.");
+		svalue = g_strdup ("");
 		break;
 	}
 



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