aboutsummaryrefslogtreecommitdiffstats
path: root/libical/src
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2003-05-08 00:49:04 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2003-05-08 00:49:04 +0800
commit5257f9dc8476832e230a406c04e5d118088773fc (patch)
tree75d9c991fc7d582b49b51dfedda8915673f1f810 /libical/src
parentb01b792f0fd65b9a11eef5402f96d5882719013e (diff)
downloadgsoc2013-evolution-5257f9dc8476832e230a406c04e5d118088773fc.tar
gsoc2013-evolution-5257f9dc8476832e230a406c04e5d118088773fc.tar.gz
gsoc2013-evolution-5257f9dc8476832e230a406c04e5d118088773fc.tar.bz2
gsoc2013-evolution-5257f9dc8476832e230a406c04e5d118088773fc.tar.lz
gsoc2013-evolution-5257f9dc8476832e230a406c04e5d118088773fc.tar.xz
gsoc2013-evolution-5257f9dc8476832e230a406c04e5d118088773fc.tar.zst
gsoc2013-evolution-5257f9dc8476832e230a406c04e5d118088773fc.zip
Fixes crash in #41631
2003-05-07 Rodrigo Moya <rodrigo@ximian.com> Fixes crash in #41631 * src/libicalvcal/icalvcal.c (icalvcal_traverse_objects): changed to return an error code and to return immediately if one of the recurrent calls return an error. (icalvcal_convert_with_defaults): if icalvcal_traverse_objects return an error, return NULL. svn path=/trunk/; revision=21122
Diffstat (limited to 'libical/src')
-rw-r--r--libical/src/libicalvcal/icalvcal.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/libical/src/libicalvcal/icalvcal.c b/libical/src/libicalvcal/icalvcal.c
index f070c9cd57..9ab3fa899e 100644
--- a/libical/src/libicalvcal/icalvcal.c
+++ b/libical/src/libicalvcal/icalvcal.c
@@ -149,10 +149,10 @@ static void convert_floating_time_to_utc (struct icaltimetype *itt)
}
-static void icalvcal_traverse_objects(VObject *object,
- icalcomponent* last_comp,
- icalproperty* last_prop,
- icalvcal_defaults *defaults)
+static int icalvcal_traverse_objects(VObject *object,
+ icalcomponent* last_comp,
+ icalproperty* last_prop,
+ icalvcal_defaults *defaults)
{
VObjectIterator iterator;
char* name = "[No Name]";
@@ -161,8 +161,7 @@ static void icalvcal_traverse_objects(VObject *object,
if ( vObjectName(object)== 0){
printf("ERROR, object has no name");
- assert(0);
- return;
+ return 0;
}
name = (char*)vObjectName(object);
@@ -185,8 +184,7 @@ static void icalvcal_traverse_objects(VObject *object,
icalproperty_set_x_name(prop,name);
icalcomponent_add_property(last_comp,prop);
} else {
- assert(0);
- return;
+ return 0;
}
} else {
@@ -276,12 +274,16 @@ static void icalvcal_traverse_objects(VObject *object,
should use it as the 'last_comp' */
if(subc!=0){
- icalvcal_traverse_objects(eachProp,subc,last_prop,defaults);
+ if (!icalvcal_traverse_objects(eachProp,subc,last_prop,defaults))
+ return 0;
} else {
- icalvcal_traverse_objects(eachProp,last_comp,last_prop,defaults);
+ if (!icalvcal_traverse_objects(eachProp,last_comp,last_prop,defaults))
+ return 0;
}
}
+
+ return 1;
}
icalcomponent* icalvcal_convert_with_defaults (VObject *object,
@@ -307,7 +309,8 @@ icalcomponent* icalvcal_convert_with_defaults (VObject *object,
printf ("===========================================\n");
#endif
- icalvcal_traverse_objects(object,container,0,defaults);
+ if (!icalvcal_traverse_objects(object,container,0,defaults))
+ return 0;
/* HACK. I am using the extra 'container' component because I am
lazy. I know there is a way to get rid of it, but I did not care