Fix ignoring of incorrect version strings in search plugins. Closes #7101.

Printing of Version with all components set to zero was segfaulting due
to underflow in array index. Also add log message for such plugins.
This commit is contained in:
Eugene Shalygin
2017-08-20 20:21:59 +02:00
parent 1e677c6728
commit ef1597e45b
2 changed files with 11 additions and 3 deletions

View File

@@ -117,7 +117,7 @@ namespace Utils
{
// find the last one non-zero component
std::size_t lastSignificantIndex = N - 1;
while (lastSignificantIndex >= 0 && (*this)[lastSignificantIndex] == 0)
while (lastSignificantIndex > 0 && (*this)[lastSignificantIndex] == 0)
--lastSignificantIndex;
if (lastSignificantIndex + 1 < Mandatory) // lastSignificantIndex >= 0