From 0d18caadae291d5fe62b904ce9c06300ba4a88fc Mon Sep 17 00:00:00 2001 From: ajacoutot Date: Fri, 18 Mar 2011 12:23:45 +0000 Subject: [PATCH] Merge SVN r1062: In parser_get_next_char(), make sure we are on at least the second character when testing if the current double-quote char is escaped. Might fix the crash reported in ID: 2994723 This fixes a crash in evolution. ok sebastia@ (maintainer) --- textproc/libical/Makefile | 4 +-- .../patches/patch-src_libical_icalparser_c | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 textproc/libical/patches/patch-src_libical_icalparser_c diff --git a/textproc/libical/Makefile b/textproc/libical/Makefile index fb5d235d9ea..256c8925e49 100644 --- a/textproc/libical/Makefile +++ b/textproc/libical/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.5 2010/11/10 22:44:03 jasper Exp $ +# $OpenBSD: Makefile,v 1.6 2011/03/18 12:23:45 ajacoutot Exp $ COMMENT= implementation of basic iCAL protocols DISTNAME= libical-0.44 -REVISION= 1 +REVISION= 2 SHARED_LIBS += ical 1.0 # .44.0 SHARED_LIBS += icalss 1.0 # .44.0 diff --git a/textproc/libical/patches/patch-src_libical_icalparser_c b/textproc/libical/patches/patch-src_libical_icalparser_c new file mode 100644 index 00000000000..30d62e2a054 --- /dev/null +++ b/textproc/libical/patches/patch-src_libical_icalparser_c @@ -0,0 +1,31 @@ +$OpenBSD: patch-src_libical_icalparser_c,v 1.1 2011/03/18 12:23:45 ajacoutot Exp $ + +SVN rev. 1062 +In parser_get_next_char(), make sure we are on at least the second character +when testing if the current double-quote char is escaped. +Might fix the crash reported in ID: 2994723 + +--- src/libical/icalparser.c.orig Sun Sep 27 04:38:51 2009 ++++ src/libical/icalparser.c Fri Mar 18 08:11:26 2011 +@@ -192,18 +192,18 @@ char* parser_get_next_char(char c, char *str, int qm) + + for(p=str; *p!=0; p++){ + if (qm == 1) { +- if ( quote_mode == 0 && *p=='"' && *(p-1) != '\\' ){ ++ if ( quote_mode == 0 && *p=='"' && p>str && *(p-1) != '\\' ){ + quote_mode =1; + continue; + } + +- if ( quote_mode == 1 && *p=='"' && *(p-1) != '\\' ){ ++ if ( quote_mode == 1 && *p=='"' && p>str && *(p-1) != '\\' ){ + quote_mode =0; + continue; + } + } + +- if (quote_mode == 0 && *p== c && *(p-1) != '\\' ){ ++ if (quote_mode == 0 && *p== c && p>str && *(p-1) != '\\' ){ + return p; + } +