Blame SOURCES/satyr-0.13-Check-the-return-value-of-sr_parse_char_cspan.patch

f41043
From 309b839354b171cd03955537102ca73bc14b7f58 Mon Sep 17 00:00:00 2001
f41043
From: Matej Habrnal <mhabrnal@redhat.com>
f41043
Date: Mon, 16 May 2016 14:19:34 +0200
f41043
Subject: [PATCH] Check the return value of sr_parse_char_cspan
f41043
f41043
Related to: #1336390
f41043
f41043
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
f41043
---
f41043
 lib/python_stacktrace.c | 12 +++++++++---
f41043
 1 file changed, 9 insertions(+), 3 deletions(-)
f41043
f41043
diff --git a/lib/python_stacktrace.c b/lib/python_stacktrace.c
f41043
index 99aa52c..557b728 100644
f41043
--- a/lib/python_stacktrace.c
f41043
+++ b/lib/python_stacktrace.c
f41043
@@ -231,9 +231,15 @@ sr_python_stacktrace_parse(const char **input,
f41043
     }
f41043
 
f41043
     /* Parse exception name. */
f41043
-    sr_parse_char_cspan(&local_input,
f41043
-                        ":\n",
f41043
-                        &stacktrace->exception_name);
f41043
+    if (!sr_parse_char_cspan(&local_input, ":\n", &stacktrace->exception_name))
f41043
+    {
f41043
+
f41043
+        location->message = "Unable to find the ':\\n' characters "
f41043
+                            "identifying the end of exception name.";
f41043
+        sr_python_stacktrace_free(stacktrace);
f41043
+        return NULL;
f41043
+
f41043
+    }
f41043
 
f41043
     *input = local_input;
f41043
     return stacktrace;
f41043
-- 
f41043
1.8.3.1
f41043