From fbf43c459c20d1134e5f9568243ddcf18c8cbd66 Mon Sep 17 00:00:00 2001 From: GetAway Date: Sun, 9 Apr 2023 16:16:57 +0200 Subject: [PATCH] controlapi.cpp: fix segfault if the bouquet number passed is less than 0 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0a4fffd038a4eda74120089ec69d93c743a7025a Author: GetAway Date: 2023-04-09 (Sun, 09 Apr 2023) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/controlapi.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index d941e5de5..cf860a8bb 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -1458,6 +1458,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))