Skip to content

Commit 5ac600a

Browse files
committed
Fix crash when a too-large cursor shape number is passed to SetCursorShape escape sequence
1 parent 3309550 commit 5ac600a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sources/VT100Terminal.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2044,7 +2044,7 @@ - (void)executeXtermSetKvp:(VT100Token *)token {
20442044
// Value must be an integer. Bogusly, non-numbers are treated as 0.
20452045
int shape = [value intValue];
20462046
ITermCursorType shapeMap[] = { CURSOR_BOX, CURSOR_VERTICAL, CURSOR_UNDERLINE };
2047-
if (shape >= 0 && shape < sizeof(shapeMap)/sizeof(int)) {
2047+
if (shape >= 0 && shape < sizeof(shapeMap)/sizeof(*shapeMap)) {
20482048
[delegate_ terminalSetCursorType:shapeMap[shape]];
20492049
}
20502050
} else if ([key isEqualToString:@"ShellIntegrationVersion"]) {

0 commit comments

Comments
 (0)