From 1a6cac9d66206e5002e72fffb87c13d5eb3ffda1 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Wed, 27 Dec 2017 01:57:15 +0100 Subject: [PATCH] UI-Coordinates: fix potential segfault ...when truncating to a position within the inline part, yet behind the actual end --- src/lib/path-array.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/path-array.hpp b/src/lib/path-array.hpp index c496e26bd..d4ea77d32 100644 --- a/src/lib/path-array.hpp +++ b/src/lib/path-array.hpp @@ -484,8 +484,9 @@ namespace lib { { Literal* end = elms_.end(); Literal* pos = getPosition(newSize); - for ( ; pos!=end; ++pos) - setContent (pos, nullptr); + if (pos) + for ( ; pos!=end; ++pos) + setContent (pos, nullptr); tail_.resizeTo (0); } else