Bug 1553820 - Follow-up. r=philipp
authorGeoff Lankow <geoff@darktrojan.net>
Fri, 07 Jun 2019 20:51:56 +1200
changeset 35829 e48bbc985397423402a45e5fbf0b63b46e7470cf
parent 35828 bab0908888b8a7f8399a440bbc345b3d895d68c4
child 35830 b27953c5a381358c0480d73971a5c91adabecb1e
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersphilipp
bugs1553820
Bug 1553820 - Follow-up. r=philipp
calendar/libical/src/libical/icalparser.c
--- a/calendar/libical/src/libical/icalparser.c
+++ b/calendar/libical/src/libical/icalparser.c
@@ -376,20 +376,19 @@ char* parser_get_next_value(char* line, 
 	    }
 	    else
 		break;
 	}
 
 	/* If the comma is preceded by a '\', then it is a literal and
 	   not a value separator*/  
       
-	if ( (next!=0 && *(next-1) == '\\') ||
-	     (next!=0 && *(next-3) == '\\')
-	    ) 
-	    /*second clause for '/' is on prev line. HACK may be out of bounds */
+  if ((next!=0 && *(next-1) == '\\') ||
+      (next!=0 && (next-3) >= line && *(next-3) == '\\' && *(next-2) == '\r' && *(next-1) == '\n'))
+      /* second clause for '\' is on prev line */
 	{
 	    p = next+1;
 	} else {
 	    break;
 	}
 
     }