protocol/ArgParser: check for invalid ranges

Catch errors like that early, before invalid ranges get passed to
internal MPD subsystems.
This commit is contained in:
Max Kellermann 2021-02-15 20:25:41 +01:00
parent 19a46064e9
commit a6c10e9a1c
2 changed files with 6 additions and 0 deletions

2
NEWS
View File

@ -1,4 +1,6 @@
ver 0.22.5 (not yet released)
* protocol
- error for malformed ranges instead of ignoring silently
* database
- simple: fix missing CUE sheet metadata in "addid" command
* tags

View File

@ -110,6 +110,10 @@ ParseCommandArgRange(const char *s)
return RangeArg::Single(range.start);
}
if (!range.IsWellFormed())
throw FormatProtocolError(ACK_ERROR_ARG,
"Malformed range: %s", s);
return range;
}