mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
parse_configfile: check quote termination properly
This is some terrible code; I blame MPlayer legacy. Found by Coverity.
This commit is contained in:
@@ -156,6 +156,13 @@ int m_config_parse_config_file(m_config_t *config, const char *conffile,
|
|||||||
c = line[line_pos];
|
c = line[line_pos];
|
||||||
++line_pos;
|
++line_pos;
|
||||||
for (param_pos = 0; line[line_pos] != c; /* NOTHING */) {
|
for (param_pos = 0; line[line_pos] != c; /* NOTHING */) {
|
||||||
|
if (!line[line_pos]) {
|
||||||
|
PRINT_LINENUM;
|
||||||
|
MP_ERR(config, "unterminated quotes\n");
|
||||||
|
ret = -1;
|
||||||
|
errors++;
|
||||||
|
goto nextline;
|
||||||
|
}
|
||||||
param[param_pos++] = line[line_pos++];
|
param[param_pos++] = line[line_pos++];
|
||||||
if (param_pos >= MAX_PARAM_LEN) {
|
if (param_pos >= MAX_PARAM_LEN) {
|
||||||
PRINT_LINENUM;
|
PRINT_LINENUM;
|
||||||
|
|||||||
Reference in New Issue
Block a user