diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index 99e679afe..794470c05 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -1738,7 +1738,7 @@ int tuxtx_main(int pid, int page, int source) subtitledelay++; // display subtitledelay PosY = StartY; - char ns[10]; + char ns[18]; SetPosX(1); sprintf(ns,"+%d ",subtitledelay); RenderCharFB(ns[0],&atrtable[ATR_WB]); @@ -1756,7 +1756,7 @@ int tuxtx_main(int pid, int page, int source) if (subtitledelay < 0) subtitledelay = 0; // display subtitledelay PosY = StartY; - char ns[10]; + char ns[18]; SetPosX(1); sprintf(ns,"+%d ",subtitledelay); RenderCharFB(ns[0],&atrtable[ATR_WB]); diff --git a/src/gui/info_menue.cpp b/src/gui/info_menue.cpp index 8320c76f7..b5714cdb8 100644 --- a/src/gui/info_menue.cpp +++ b/src/gui/info_menue.cpp @@ -75,9 +75,10 @@ int CInfoMenu::exec(CMenuTarget *parent, const std::string &actionKey) if (actionKey == "cs_get_info") { #if HAVE_CST_HARDWARE - char str[1024] = {}; - sprintf(str, "cs_get_revision(): 0x%02X\n", cs_get_revision()); - sprintf(str, "%scs_get_chip_type(): 0x%04X\n", str, cs_get_chip_type()); + char str[128] = {}; + sprintf(str, "cs_get_revision(): 0x%02X\n" + "cs_get_chip_type(): 0x%04X\n", + cs_get_revision(), cs_get_chip_type()); ShowMsg(LOCALE_MESSAGEBOX_INFO, str, CMsgBox::mbrBack, CMsgBox::mbBack); return res; #endif diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index e4b0d638b..473e75c8b 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -2522,13 +2522,13 @@ void CMoviePlayerGui::selectAudioPid() defpid = false; } - char cnt[5]; + char cnt[6]; sprintf(cnt, "%d", count); CMenuForwarder * item = new CMenuForwarder(apidtitle.c_str(), enabled, NULL, selector, cnt, CRCInput::convertDigitToKey(count + 1)); APIDSelector.addItem(item, defpid); } #if HAVE_CST_HARDWARE - char cnt[5]; + char cnt[6]; sprintf(cnt, "%d", count); std::string apidtitle; if (g_settings.movieplayer_select_ac3_atype0 == false) diff --git a/src/gui/network_setup.cpp b/src/gui/network_setup.cpp index e1369581f..90f4b484a 100644 --- a/src/gui/network_setup.cpp +++ b/src/gui/network_setup.cpp @@ -828,7 +828,7 @@ int CNetworkSetup::showWlanList() CMenuWidget wlist(LOCALE_MAINSETTINGS_NETWORK, NEUTRINO_ICON_NETWORK, width); wlist.addIntroItems(LOCALE_NETWORKMENU_SSID_SCAN); //intros - char cnt[10]; + char cnt[12]; int select = -1; CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select); diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index f84b66e55..71271e916 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -3078,6 +3078,8 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) std::string _rec_dir = hh->ParamList["rec_dir"]; void *data=NULL; bool standby_on = false; + char msg[256]; + static_assert(EXEC_PLUGIN_NAME_MAXLEN <= sizeof(msg) && REMINDER_MESSAGE_MAXLEN <= sizeof(msg), "Timer msg size mismatch"); if(type == CTimerd::TIMER_RECORD) announceTimeT-=120; if(type == CTimerd::TIMER_STANDBY) @@ -3106,17 +3108,15 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) } else if(type==CTimerd::TIMER_REMIND) { - char msg[REMINDER_MESSAGE_MAXLEN]; - memset(msg, 0, sizeof(msg)); + memset(msg, 0, REMINDER_MESSAGE_MAXLEN); strncpy(msg, hh->ParamList["msg"].c_str(),REMINDER_MESSAGE_MAXLEN-1); - data=msg; + data = msg; } else if(type==CTimerd::TIMER_EXEC_PLUGIN) { - char msg[EXEC_PLUGIN_NAME_MAXLEN]; - memset(msg, 0, sizeof(msg)); + memset(msg, 0, EXEC_PLUGIN_NAME_MAXLEN); strncpy(msg, hh->ParamList["PluginName"].c_str(),EXEC_PLUGIN_NAME_MAXLEN-1); - data=msg; + data = msg; } // update or add timer if(hh->ParamList["update"]=="1")