controlapi.cpp: fix segfault if the bouquet number passed is less than 0

This commit is contained in:
GetAway
2023-04-09 16:16:57 +02:00
parent 8132fb17fe
commit be5786eebb

View File

@@ -1449,6 +1449,8 @@ void CControlAPI::GetBouquetCGI(CyhookHandler *hh)
if (!hh->ParamList["bouquet"].empty()) {
// list for given bouquet
BouquetNr = atoi(hh->ParamList["bouquet"].c_str());
if (BouquetNr < 0)
BouquetNr = 0;
if (BouquetNr > 0)
BouquetNr--;
if((BouquetNr > 0) && (BouquetNr >= bsize))