From c7ca8102c002287f492ca71f2193ee9b269f5bf5 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Sat, 17 Mar 2018 13:36:38 +0100 Subject: fix a crash when trying to append to a NULL line reported by @vague666 --- src/fe-text/textbuffer-view.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/fe-text/textbuffer-view.c') diff --git a/src/fe-text/textbuffer-view.c b/src/fe-text/textbuffer-view.c index 99625ecc..3ccd95f5 100644 --- a/src/fe-text/textbuffer-view.c +++ b/src/fe-text/textbuffer-view.c @@ -913,11 +913,14 @@ void textbuffer_view_resize(TEXT_BUFFER_VIEW_REC *view, int width, int height) } else if (view->startline == view->bottom_startline && view->subline > view->bottom_subline) { view->subline = view->bottom_subline; - } else { + } else if (view->startline != NULL) { /* make sure the subline is still in allowed range */ linecount = view_get_linecount(view, view->startline); if (view->subline > linecount) view->subline = linecount; + } else { + /* we don't have a startline. still under construction? */ + view->subline = 0; } textbuffer_view_init_ypos(view); -- cgit v1.2.3