[evolution-patches] libical valgrindage



This doesn't actually fix any known problem so it doesn't really have to
go in for 1.4.0, but it could.

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/libical/ChangeLog,v
retrieving revision 1.140
diff -u -r1.140 ChangeLog
--- ChangeLog	14 May 2003 22:04:38 -0000	1.140
+++ ChangeLog	20 May 2003 13:08:02 -0000
@@ -1,3 +1,8 @@
+2003-05-20  Dan Winship  <danw ximian com>
+
+	* src/libical/icalparser.c (icalparser_get_next_char): Don't look
+	at *(p-1) when p==str. Noticed by valgrind.
+
 2003-05-14  Rodrigo Moya <rodrigo ximian com>
 
 	Fixes #41579
Index: src/libical/icalparser.c
===================================================================
RCS file: /cvs/gnome/libical/src/libical/icalparser.c,v
retrieving revision 1.15
diff -u -r1.15 icalparser.c
--- src/libical/icalparser.c	23 Jul 2001 23:30:11 -0000	1.15
+++ src/libical/icalparser.c	20 May 2003 13:08:02 -0000
@@ -149,18 +149,18 @@
 
     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;
 		}
     }


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