mirror of https://github.com/mpv-player/mpv
terminal-unix: reject overlong termcap strings
Our own tables have size for only 8 chars, so these sequences must be rejected. It seems strings of length 8 are still ok, because the code uses memcmp and not strcmp, so still allow these. Based on mplayer-svn commit r37129.
This commit is contained in:
parent
39b2e20698
commit
f0e08c01ff
|
@ -87,6 +87,9 @@ static char *term_smkx = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static keycode_st *keys_push(char *p, int code) {
|
static keycode_st *keys_push(char *p, int code) {
|
||||||
|
if (strlen(p) > 8)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (getch2_keys.len == getch2_keys.cap) {
|
if (getch2_keys.len == getch2_keys.cap) {
|
||||||
getch2_keys.cap *= 2;
|
getch2_keys.cap *= 2;
|
||||||
if (getch2_keys.cap == 0)
|
if (getch2_keys.cap == 0)
|
||||||
|
|
Loading…
Reference in New Issue