54147: avoid buffer overflow with terminal sequences

This commit is contained in:
Oliver Kiddle
2025-12-16 01:13:40 +01:00
parent 4a99cc2669
commit af47b22167
2 changed files with 7 additions and 2 deletions

View File

@@ -1,3 +1,8 @@
2025-12-16 Oliver Kiddle <opk@zsh.org>
* 54147: Src/Zle/termquery.c: avoid buffer overflow with
terminal sequences
2025-11-30 Oliver Kiddle <opk@zsh.org>
* Christopher Bock: 54117: update apt completion

View File

@@ -703,10 +703,10 @@ collate_seq(int sindex, int dir)
}
if (enabled) {
if (i)
strucpy(&pos, editext[i].seq[sindex]);
struncpy(&pos, editext[i].seq[sindex], seq + sizeof(seq) - pos - 1);
else if ((bracket = getaparam("zle_bracketed_paste")) &&
arrlen(bracket) == 2)
strucpy(&pos, bracket[sindex]);
struncpy(&pos, bracket[sindex], seq + sizeof(seq) - pos - 1);
}
}
write_loop(SHTTY, seq, pos - seq);