-fixes strncpy & buf size

This commit is contained in:
satbaby
2012-08-07 18:51:44 +02:00
parent af74eb4f7e
commit 7359504dd7
15 changed files with 48 additions and 44 deletions

View File

@@ -232,14 +232,14 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
}
else if(manual || !scan_all) {
sat.position = CServiceManager::getInstance()->GetSatellitePosition(scansettings.satNameNoDiseqc);
strncpy(sat.satName, scansettings.satNameNoDiseqc, 50);
strncpy(sat.satName, scansettings.satNameNoDiseqc, 49);
satList.push_back(sat);
} else {
satellite_map_t & satmap = CServiceManager::getInstance()->SatelliteList();
for(sit = satmap.begin(); sit != satmap.end(); ++sit) {
if(sit->second.use_in_scan) {
sat.position = sit->first;
strncpy(sat.satName, sit->second.name.c_str(), 50);
strncpy(sat.satName, sit->second.name.c_str(), 49);
satList.push_back(sat);
}
}