[glabels] Fix out of bounds read when label is empty



commit d81ae52ed8a563aae55353b85db42cae7c7eed41
Author: Clemens Fries <githubert xenoworld de>
Date:   Mon Sep 18 21:05:48 2017 +0200

    Fix out of bounds read when label is empty

 src/text-node.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/text-node.c b/src/text-node.c
index 2b5cad0..86d3ad6 100644
--- a/src/text-node.c
+++ b/src/text-node.c
@@ -283,7 +283,7 @@ gl_text_node_lines_new_from_text (const gchar *text)
                        nodes = NULL;
                }
        }
-       if (*(p - 1) != '\n') {
+       if (p != text && *(p - 1) != '\n') {
                lines = g_list_append (lines, nodes);
        }
 


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