summaryrefslogtreecommitdiffstats
path: root/screen-write.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2023-11-02 22:58:45 +0000
committerThomas Adam <thomas@xteddy.org>2023-11-02 22:58:45 +0000
commit381c00a74ea1eb136a97c86da9a7713190b10a62 (patch)
tree03a9f8bd56a65cff8c7c8be340fdd6e8e8600240 /screen-write.c
parenta5545dbc9f576d8f324333942eda562f3b80beeb (diff)
parent5aadee6df4750a4c428fc7e7edc9e8e315c3f610 (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'screen-write.c')
-rw-r--r--screen-write.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/screen-write.c b/screen-write.c
index 923dac6e..6892d041 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -2110,7 +2110,7 @@ screen_write_combine(struct screen_write_ctx *ctx, const struct grid_cell *gc)
/*
* Check if we need to combine characters. This could be zero width
- * (zet above), a modifier character (with an existing Unicode
+ * (set above), a modifier character (with an existing Unicode
* character) or a previous ZWJ.
*/
if (!zero_width) {
@@ -2122,6 +2122,10 @@ screen_write_combine(struct screen_write_ctx *ctx, const struct grid_cell *gc)
return (0);
}
+ /* Check if this combined character would be too long. */
+ if (last.data.size + ud->size > sizeof last.data.data)
+ return (0);
+
/* Combining; flush any pending output. */
screen_write_collect_flush(ctx, 0, __func__);