Skip to content

Commit 396fd1e

Browse files
chrisbrazeertzjq
andcommitted
patch 9.1.0707: [security]: invalid cursor position may cause a crash
Problem: [security]: invalid cursor position may cause a crash (after v9.1.0038) Solution: Set cursor to the last character in a line, if it would otherwise point to beyond the line; no tests added, as it is unclear how to reproduce this. Github Advisory: GHSA-4ghr-c62x-cqfh Co-authored-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 75ba87b commit 396fd1e

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/charset.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,6 +1678,9 @@ getvcol(
16781678
}
16791679
clear_chartabsize_arg(&cts);
16801680

1681+
if (*ptr == NUL && pos->col < MAXCOL && pos->col > ptr - line)
1682+
pos->col = ptr - line;
1683+
16811684
if (start != NULL)
16821685
*start = vcol + head;
16831686
if (end != NULL)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
707,
707709
/**/
708710
706,
709711
/**/

0 commit comments

Comments
 (0)