aboutsummaryrefslogtreecommitdiffstats
path: root/libical
diff options
context:
space:
mode:
Diffstat (limited to 'libical')
-rw-r--r--libical/ChangeLog10
-rw-r--r--libical/src/libicalvcal/icalvcal.c25
2 files changed, 24 insertions, 11 deletions
diff --git a/libical/ChangeLog b/libical/ChangeLog
index 8d9542b7a3..78b9f9a902 100644
--- a/libical/ChangeLog
+++ b/libical/ChangeLog
@@ -1,3 +1,13 @@
+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.
+
2003-03-17 Hans Petter Jansson <hpj@ximian.com>
Part of fix for #34095
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