[evolution-patches] 4 x bugreport



Hello,
I found small bugs in Evolution (1.4.5) in file
calendar/cal-util/cal-recur.c:

====================================
If EVENT does not have DTEND then DTSTART is used (time is copied from
DTSTART to DTEND), but TZID is not copied. Instead, "default_timezone"
is used for DTEND, which is wrong behavior (DTSTART can be from diferent
timezone).

I suggest to add "dtend.tzid = g_strdup (dtstart.tzid);" on the line
728. Then timezone will be copied too.


====================================
In the case that EVENT has neither DTEND nor RRULES and DTSTART is TIME
value (not DATE value) then cal_recur_generate_instances (comp, -1, -1,
...) returns empty result. But cal_recur_generate_instances (comp, 0,
-1, ...) returns correct result (instance_start=DTSTART,
instance_end=DTSTART).

I temporary corrected this by changing cal-recur.c:708-709 from 

if (start == -1)
   start = dtstart_time;

to

if (start == -1)
   start = dtstart_time - 1;


====================================
In the case that EVENT has DTSTART same as DTEND (both are TIME values)
then cal_recur_generate_instances (comp, DTSTART, ...) returns empty
result. But cal_recur_generate_instances (comp, DTSTART - 1, ...)
returns correct result (instance_start=DTSTART, instance_end=DTEND). You
can see this bug in Evolution, when you add EVENT width DSTART=0:0 and
DTEND=0:0.

I temporary corrected this by changing cal-recur.c:708-709 from 

if (start == -1)
   start = dtstart_time - 1;

to

if (start == -1 || start == dtstart_time)
   start = dtstart_time - 1;
 

====================================
Patch:

--- evolution.orig/calendar/cal-util/cal-recur.c	2003-03-05 15:48:49.000000000 +0100
+++ evolution/calendar/cal-util/cal-recur.c	2004-01-28 10:16:28.000000000 +0100
@@ -705,8 +705,8 @@
 
 	dtstart_time = icaltime_as_timet_with_zone (*dtstart.value,
 						    start_zone);
-	if (start == -1)
-		start = dtstart_time;
+	if (start == -1 || start == dtstart_time)
+		start = dtstart_time - 1;
 
 	if (dtend.value) {
 		/* If both DTSTART and DTEND are DATE values, and they are the
@@ -725,6 +725,7 @@
 		   If DTSTART is a DATE value we add 1 day. */
 		dtend.value = g_new (struct icaltimetype, 1);
 		*dtend.value = *dtstart.value;
+                dtend.tzid = g_strdup (dtstart.tzid);
 
 		if (dtstart.value->is_date) {
 			icaltime_adjust (dtend.value, 1, 0, 0, 0);


====================================
I have discovered an "unpleasant" bug in the libical library, which is
included in Evolution. Library sometimes frees one memory twice and then
ends with SIGSEGV.

Function `icalmemory_append_string' reallocates string `str' (`str' can
be moved to another location) in original source.  But initial location
will be freed again at another libical call. Small patch follows: 


--- evolution.orig/libical/src/libical/icalrecur.c Thu Oct 30 09:14:09 2003
+++ evolution/libical/src/libical/icalrecur.c Thu Oct 30 09:15:42 2003
@@ -475,7 +475,7 @@
        return 0;
     }

-    str = (char*)icalmemory_tmp_buffer(buf_sz);
+    str = (char*)icalmemory_new_buffer(buf_sz);
     str_p = str;

     icalmemory_append_string(&str,&str_p,&buf_sz,"FREQ=");
@@ -545,6 +545,7 @@
        }
     }

+    icalmemory_add_tmp_buffer(str);
     return  str;
 }
 #endif



-- 
S pozdravem Jan Becvar
jan becvar solnet cz
soLNet, s.r.o.





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