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)
This commit is contained in:
ajacoutot 2011-03-18 12:23:45 +00:00
parent 03c4a64f86
commit 0d18caadae
2 changed files with 33 additions and 2 deletions

View File

@ -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

View File

@ -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;
}