From 1cedd9fd6a363bb66623b4b7093e01cb68e59cce Mon Sep 17 00:00:00 2001 From: Kevin Kofler Date: Tue, 28 Oct 2008 05:07:56 +0000 Subject: [PATCH] - Update to 0.40. - Add patch from upstream to fix crash in icalvalue.c. --- .cvsignore | 2 +- libical-0.40-icalvalue-crash.patch | 81 ++++++++++++++++++++++++++++++ libical.spec | 10 +++- sources | 2 +- 4 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 libical-0.40-icalvalue-crash.patch diff --git a/.cvsignore b/.cvsignore index fe84aef..4c1c54f 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -libical-0.32.tar.gz +libical-0.40.tar.gz diff --git a/libical-0.40-icalvalue-crash.patch b/libical-0.40-icalvalue-crash.patch new file mode 100644 index 0000000..807f69e --- /dev/null +++ b/libical-0.40-icalvalue-crash.patch @@ -0,0 +1,81 @@ +--- trunk/libical/src/libical/icalvalue.c 2008/10/27 16:19:27 890 ++++ trunk/libical/src/libical/icalvalue.c 2008/10/27 23:20:34 891 +@@ -948,24 +948,29 @@ + void print_time_to_string(char* str, const struct icaltimetype *data) + { + char temp[20]; ++ str[0] = '\0'; + +- if (icaltime_is_utc(*data)){ +- snprintf(temp,sizeof(temp),"%02d%02d%02dZ",data->hour,data->minute,data->second); +- } else { +- snprintf(temp,sizeof(temp),"%02d%02d%02d",data->hour,data->minute,data->second); +- } +- +- strcat(str,temp); ++ if (data != 0) { ++ if (icaltime_is_utc(*data)){ ++ snprintf(temp,sizeof(temp),"%02d%02d%02dZ",data->hour,data->minute,data->second); ++ strncat(str,temp,7); ++ } else { ++ snprintf(temp,sizeof(temp),"%02d%02d%02d",data->hour,data->minute,data->second); ++ strncat(str,temp,6); ++ } ++ } + } + + + void print_date_to_string(char* str, const struct icaltimetype *data) + { + char temp[20]; ++ str[0] = '\0'; + +- snprintf(temp,sizeof(temp),"%04d%02d%02d",data->year,data->month,data->day); +- +- strcat(str,temp); ++ if (data != 0) { ++ snprintf(temp,sizeof(temp),"%04d%02d%02d",data->year,data->month,data->day); ++ strncat(str,temp,8); ++ } + } + + static char* icalvalue_date_as_ical_string_r(const icalvalue* value) { +@@ -977,7 +982,7 @@ + + str = (char*)icalmemory_new_buffer(9); + +- str[0] = 0; ++ str[0] = '\0'; + print_date_to_string(str,&data); + + return str; +@@ -985,10 +990,17 @@ + + void print_datetime_to_string(char* str, const struct icaltimetype *data) + { +- print_date_to_string(str,data); +- if ( !data->is_date ) { +- strcat(str,"T"); +- print_time_to_string(str,data); ++ char temp[20]; ++ str[0] = '\0'; ++ ++ if (data != 0) { ++ print_date_to_string(str,data); ++ if ( !data->is_date ) { ++ strncat(str,"T",19); ++ temp[0] = '\0'; ++ print_time_to_string(temp,data); ++ strncat(str,temp,19); ++ } + } + } + +@@ -1013,7 +1025,6 @@ + str = (char*)icalmemory_new_buffer(20); + + str[0] = 0; +- + print_datetime_to_string(str,&data); + + return str; diff --git a/libical.spec b/libical.spec index cd8a61c..2509272 100644 --- a/libical.spec +++ b/libical.spec @@ -1,5 +1,5 @@ Name: libical -Version: 0.32 +Version: 0.40 Release: 1%{?dist} Summary: Reference implementation of the iCalendar data type and serialization format Summary(pl): Implementacja formatu iCalendar @@ -10,6 +10,9 @@ URL: http://freeassociation.sourceforge.net/ Source0: http://downloads.sourceforge.net/freeassociation/%{name}-%{version}.tar.gz Patch0: %{name}-%{version}-makefile.patch +# patch from upstream to fix crash in icalvalue.c: +# http://freeassociation.svn.sourceforge.net/viewvc/freeassociation?view=rev&revision=891 +Patch1: libical-0.40-icalvalue-crash.patch BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) @@ -42,6 +45,7 @@ korzystajÄ…cych z libical. %prep %setup -q %patch0 -p1 +%patch1 -p2 %build %configure --disable-static -enable-cxx --enable-reentrant @@ -110,6 +114,10 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/libicalvcal/vobject.h %changelog +* Tue Oct 28 2008 Kevin Kofler - 0.40-1 +- Update to 0.40. +- Add patch from upstream to fix crash in icalvalue.c. + * Tue Sep 03 2008 Debarshi Ray - 0.32-1 - Version bump to 0.32. - Parallel build problems fixed. diff --git a/sources b/sources index f3207e7..af8cfd6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -7e38be0c75769e62b7f76c5b6f373db9 libical-0.32.tar.gz +bbf9579135ce9b0be2979d104a8dc2fe libical-0.40.tar.gz