[gobject-introspection] Do not segfault on comments with invalid UTF-8
- From: Pascal Terjan <pterjan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] Do not segfault on comments with invalid UTF-8
- Date: Mon, 7 Mar 2016 09:55:53 +0000 (UTC)
commit db47c44565b443d8f1cb1280061762a7bc607a86
Author: Pascal Terjan <pterjan google com>
Date: Fri Mar 4 00:40:39 2016 +0000
Do not segfault on comments with invalid UTF-8
giscanner/giscannermodule.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/giscanner/giscannermodule.c b/giscanner/giscannermodule.c
index cd0718e..4c1f00f 100644
--- a/giscanner/giscannermodule.c
+++ b/giscanner/giscannermodule.c
@@ -631,6 +631,12 @@ pygi_source_scanner_get_comments (PyGISourceScanner *self)
if (comment->comment)
{
comment_obj = PyUnicode_FromString (comment->comment);
+ if (!comment_obj)
+ {
+ g_print ("Comment is not valid Unicode in %s line %d\n", comment->filename, comment->line);
+ Py_INCREF (Py_None);
+ comment_obj = Py_None;
+ }
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]