Mercurial > vim
comparison src/libvterm/src/termscreen.c @ 18162:9c3347b21b89 v8.1.2076
patch 8.1.2076: crash when trying to put a terminal in a popup window
Commit: https://github.com/vim/vim/commit/e0d749a49630778d45642d7589a3703697746760
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Sep 25 22:14:48 2019 +0200
patch 8.1.2076: crash when trying to put a terminal in a popup window
Problem: Crash when trying to put a terminal buffer in a popup window.
Solution: Check for NULL buffer. Do not allow putting a terminal in a popup
window.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 25 Sep 2019 22:15:03 +0200 |
parents | 8b4f9be5db73 |
children |
comparison
equal
deleted
inserted
replaced
18161:94e3c1e4d5ae | 18162:9c3347b21b89 |
---|---|
72 static ScreenCell *getcell(const VTermScreen *screen, int row, int col) | 72 static ScreenCell *getcell(const VTermScreen *screen, int row, int col) |
73 { | 73 { |
74 if(row < 0 || row >= screen->rows) | 74 if(row < 0 || row >= screen->rows) |
75 return NULL; | 75 return NULL; |
76 if(col < 0 || col >= screen->cols) | 76 if(col < 0 || col >= screen->cols) |
77 return NULL; | |
78 if (screen->buffer == NULL) | |
77 return NULL; | 79 return NULL; |
78 return screen->buffer + (screen->cols * row) + col; | 80 return screen->buffer + (screen->cols * row) + col; |
79 } | 81 } |
80 | 82 |
81 static ScreenCell *realloc_buffer(VTermScreen *screen, ScreenCell *buffer, int new_rows, int new_cols) | 83 static ScreenCell *realloc_buffer(VTermScreen *screen, ScreenCell *buffer, int new_rows, int new_cols) |