diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-06-09 15:33:26 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-06-09 15:33:26 +0000 |
| commit | f72c982c896c35ad71d366a06684229c04e3ed54 (patch) | |
| tree | 084baab2812a3604d6217f7baa05aa52d72342d6 | |
| parent | csi: \E[3J: reset render.last_cursor.row if necessary (diff) | |
osc: don't assert on \E]4 being followed by a ';'
This fixes a crash (in debug builds) that could be triggered by
e.g. cat:ing /dev/urandom.
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | osc.c | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index d11caa1b..4f91a08d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,8 @@ * Sixel images being erased when printing text next to them. * Crash when last rendered cursor cell had scrolled off screen and `\E[J3` was executed. +* Assert (debug builds) when an `\e]4` OSC escape was not followed by + a `;`. ### Security @@ -431,6 +431,9 @@ osc_dispatch(struct terminal *term) /* Set color<idx> */ string--; + if (*string != ';') + break; + assert(*string == ';'); for (const char *s_idx = strtok(string, ";"), *s_color = strtok(NULL, ";"); |
