mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-29 07:58:01 -04:00
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.
This commit is contained in:
parent
bf57d0c606
commit
f72c982c89
2 changed files with 5 additions and 0 deletions
|
|
@ -57,6 +57,8 @@
|
||||||
* Sixel images being erased when printing text next to them.
|
* Sixel images being erased when printing text next to them.
|
||||||
* Crash when last rendered cursor cell had scrolled off screen and
|
* Crash when last rendered cursor cell had scrolled off screen and
|
||||||
`\E[J3` was executed.
|
`\E[J3` was executed.
|
||||||
|
* Assert (debug builds) when an `\e]4` OSC escape was not followed by
|
||||||
|
a `;`.
|
||||||
|
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
|
||||||
3
osc.c
3
osc.c
|
|
@ -431,6 +431,9 @@ osc_dispatch(struct terminal *term)
|
||||||
/* Set color<idx> */
|
/* Set color<idx> */
|
||||||
|
|
||||||
string--;
|
string--;
|
||||||
|
if (*string != ';')
|
||||||
|
break;
|
||||||
|
|
||||||
assert(*string == ';');
|
assert(*string == ';');
|
||||||
|
|
||||||
for (const char *s_idx = strtok(string, ";"), *s_color = strtok(NULL, ";");
|
for (const char *s_idx = strtok(string, ";"), *s_color = strtok(NULL, ";");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue