comparison src/screen.c @ 16994:9c4cf27deb87 v8.1.1497

patch 8.1.1497: accessing memory beyond allocated space commit https://github.com/vim/vim/commit/aef5c62a6fff7654bb8df7b9359e811f7a6e428f Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 8 17:25:33 2019 +0200 patch 8.1.1497: accessing memory beyond allocated space Problem: Accessing memory beyond allocated space. Solution: Check column before accessing popup mask.
author Bram Moolenaar <Bram@vim.org>
date Sat, 08 Jun 2019 17:30:06 +0200
parents f824831e2805
children 2ec0f953ec3f
comparison
equal deleted inserted replaced
16993:0f93d3f72217 16994:9c4cf27deb87
6795 } 6795 }
6796 6796
6797 if (clear_width > 0 6797 if (clear_width > 0
6798 #ifdef FEAT_TEXT_PROP 6798 #ifdef FEAT_TEXT_PROP
6799 && !(flags & SLF_POPUP) // no separator for popup window 6799 && !(flags & SLF_POPUP) // no separator for popup window
6800 && popup_mask[row * screen_Columns + col + coloff] <= screen_zindex
6801 #endif 6800 #endif
6802 ) 6801 )
6803 { 6802 {
6804 // For a window that has a right neighbor, draw the separator char 6803 // For a window that has a right neighbor, draw the separator char
6805 // right of the window contents. 6804 // right of the window contents. But not on top of a popup window.
6806 if (coloff + col < Columns) 6805 if (coloff + col < Columns)
6807 { 6806 {
6808 int c; 6807 #ifdef FEAT_TEXT_PROP
6809 6808 if (popup_mask[row * screen_Columns + col + coloff]
6810 c = fillchar_vsep(&hl); 6809 <= screen_zindex)
6811 if (ScreenLines[off_to] != (schar_T)c 6810 #endif
6812 || (enc_utf8 && (int)ScreenLinesUC[off_to] 6811 {
6813 != (c >= 0x80 ? c : 0)) 6812 int c;
6814 || ScreenAttrs[off_to] != hl) 6813
6815 { 6814 c = fillchar_vsep(&hl);
6816 ScreenLines[off_to] = c; 6815 if (ScreenLines[off_to] != (schar_T)c
6817 ScreenAttrs[off_to] = hl; 6816 || (enc_utf8 && (int)ScreenLinesUC[off_to]
6818 if (enc_utf8) 6817 != (c >= 0x80 ? c : 0))
6819 { 6818 || ScreenAttrs[off_to] != hl)
6820 if (c >= 0x80) 6819 {
6820 ScreenLines[off_to] = c;
6821 ScreenAttrs[off_to] = hl;
6822 if (enc_utf8)
6821 { 6823 {
6822 ScreenLinesUC[off_to] = c; 6824 if (c >= 0x80)
6823 ScreenLinesC[0][off_to] = 0; 6825 {
6826 ScreenLinesUC[off_to] = c;
6827 ScreenLinesC[0][off_to] = 0;
6828 }
6829 else
6830 ScreenLinesUC[off_to] = 0;
6824 } 6831 }
6825 else 6832 screen_char(off_to, row, col + coloff);
6826 ScreenLinesUC[off_to] = 0; 6833 }
6827 }
6828 screen_char(off_to, row, col + coloff);
6829 } 6834 }
6830 } 6835 }
6831 else 6836 else
6832 LineWraps[row] = FALSE; 6837 LineWraps[row] = FALSE;
6833 } 6838 }