summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-21 10:08:20 +0100
committerwm4 <wm4@nowhere>2014-11-21 10:09:45 +0100
commit863a05025825bca41afe733db983d3eae5702d35 (patch)
tree0dae48fd5b248d85887ceb5a171814553510a591
parent75f38dcc9af5283929152ae097c6085c03c1219f (diff)
downloadmpv-863a05025825bca41afe733db983d3eae5702d35.tar.bz2
mpv-863a05025825bca41afe733db983d3eae5702d35.tar.xz
parse_configfile: check quote termination properly
This is some terrible code; I blame MPlayer legacy. Found by Coverity.
-rw-r--r--options/parse_configfile.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/options/parse_configfile.c b/options/parse_configfile.c
index 44ac649592..48a2c25318 100644
--- a/options/parse_configfile.c
+++ b/options/parse_configfile.c
@@ -156,6 +156,13 @@ int m_config_parse_config_file(m_config_t *config, const char *conffile,
c = line[line_pos];
++line_pos;
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++];
if (param_pos >= MAX_PARAM_LEN) {
PRINT_LINENUM;