From 6fae3545c7ce93cec3c3b62c340850ae7a472c72 Mon Sep 17 00:00:00 2001 From: s1341 Date: Sun, 25 Aug 2019 16:39:39 +0300 Subject: [PATCH] Fix null pointer deref --- kitty/line.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kitty/line.c b/kitty/line.c index cb2e446e4..dcd647e4c 100644 --- a/kitty/line.c +++ b/kitty/line.c @@ -268,9 +268,9 @@ line_as_ansi(Line *self, Py_UCS4 *buf, index_type buflen, bool *truncated, GPUCe char_type previous_width = 0; GPUCell blank_cell = { 0 }; - GPUCell *cell; + GPUCell *cell, *temp_cell = &blank_cell; if (prev_cell == NULL || *prev_cell == NULL) { - *prev_cell = &blank_cell; + prev_cell = &temp_cell; } for (index_type pos=0; pos < limit; pos++) {