Skip to content
Snippets Groups Projects
Commit 72b1a6ed authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Avoid read out of bounds in bad CSI m

In the CSI 38 : 2 : Z? : R : G : B m variant, if there was no
sub params (ie: CSI 38 : m), a read out of bounds would be
triggered.
Found by scan-build
parent 0b61127f
No related branches found
No related tags found
No related merge requests found
......@@ -2427,7 +2427,7 @@ static void parse_extended_colour(struct esc_seq *seq, int *i, struct cterminal
*co = sub.param_int[2];
save_extended_colour_seq(cterm, fg, seq, *i, 1);
}
else if (sub.param_int[1] == 2) {
else if (sub.param_count >= 5 && sub.param_int[1] == 2) {
if (sub.param_count == 5) {
nc = map_rgb(sub.param_int[2]<<8, sub.param_int[3]<<8, sub.param_int[4]<<8);
if (nc != UINT32_MAX)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment