diff --git a/NEWS b/NEWS index 5c40e4f6c..670cb3256 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.20.19 (not yet released) +* protocol + - validate absolute seek time, reject negative values * macOS: fix crash bug ver 0.20.18 (2018/02/24) diff --git a/src/protocol/ArgParser.cxx b/src/protocol/ArgParser.cxx index 47fdfa405..bdc28bcbf 100644 --- a/src/protocol/ArgParser.cxx +++ b/src/protocol/ArgParser.cxx @@ -164,6 +164,10 @@ SongTime ParseCommandArgSongTime(const char *s) { auto value = ParseCommandArgFloat(s); + if (value < 0) + throw FormatProtocolError(ACK_ERROR_ARG, + "Negative value not allowed: %s", s); + return SongTime::FromS(value); }