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:
Daniel Eklöf 2020-06-09 17:33:26 +02:00
parent bf57d0c606
commit f72c982c89
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 5 additions and 0 deletions

3
osc.c
View file

@ -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, ";");