File libical-boo986631-check-prev-char.patch of Package libical.17518

From 04d84749e53db08c71ed0ce8b6ba5c11082743cd Mon Sep 17 00:00:00 2001
From: Ken Murchison <murch@andrew.cmu.edu>
Date: Fri, 2 Dec 2016 14:14:03 -0500
Subject: [PATCH] icalparser.c: make sure we have a prev_char before checking
 it

---
 src/libical/icalparser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libical/icalparser.c b/src/libical/icalparser.c
index 9d332375..2735c9ac 100644
--- a/src/libical/icalparser.c
+++ b/src/libical/icalparser.c
@@ -148,7 +148,7 @@ static char *parser_get_next_char(char c, char *str, int qm)
     char prev_char = 0;
 
     while (next_char != 0) {
-        if (prev_char != '\\') {
+        if (prev_char && prev_char != '\\') {
             if (qm == 1 && next_char == '"') {
                 /* Encountered a quote, toggle quote mode */
                 quote_mode = !quote_mode;
-- 
2.12.3
openSUSE Build Service is sponsored by