mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
fix AddressSanitizer: strncpy-param-overlap: memory ranges
This commit is contained in:
@@ -507,24 +507,30 @@ void CRemoteControl::processAPIDnames()
|
||||
{
|
||||
has_unresolved_ctags= true;
|
||||
}
|
||||
if ( strlen( current_PIDs.APIDs[count].desc ) == 3 )
|
||||
std::string tmp_desc = current_PIDs.APIDs[count].desc;
|
||||
if ( tmp_desc.size() == 3 )
|
||||
{
|
||||
// unaufgeloeste Sprache...
|
||||
strcpy( current_PIDs.APIDs[count].desc, getISO639Description( current_PIDs.APIDs[count].desc ) );
|
||||
tmp_desc = getISO639Description( current_PIDs.APIDs[count].desc );
|
||||
}
|
||||
|
||||
if ( current_PIDs.APIDs[count].is_ac3 )
|
||||
{
|
||||
if(!strstr(current_PIDs.APIDs[count].desc, " (AC3)"))
|
||||
strncat(current_PIDs.APIDs[count].desc, " (AC3)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[count].desc)-1);
|
||||
tmp_desc += " (AC3)";
|
||||
has_ac3 = true;
|
||||
if(g_settings.audio_DolbyDigital && (ac3_found < 0))
|
||||
ac3_found = count;
|
||||
}
|
||||
else if (current_PIDs.APIDs[count].is_aac && !strstr(current_PIDs.APIDs[count].desc, " (AAC)"))
|
||||
strncat(current_PIDs.APIDs[count].desc, " (AAC)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[count].desc)-1);
|
||||
tmp_desc += " (AAC)";
|
||||
else if (current_PIDs.APIDs[count].is_eac3 && !strstr(current_PIDs.APIDs[count].desc, " (EAC3)"))
|
||||
strncat(current_PIDs.APIDs[count].desc, " (EAC3)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[count].desc)-1);
|
||||
tmp_desc += " (EAC3)";
|
||||
|
||||
if(!tmp_desc.empty()){
|
||||
strncpy(current_PIDs.APIDs[count].desc, tmp_desc.c_str(), DESC_MAX_LEN -1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( has_unresolved_ctags )
|
||||
@@ -545,13 +551,17 @@ void CRemoteControl::processAPIDnames()
|
||||
// workaround for buggy ZDF ctags / or buggy sectionsd/drivers , who knows...
|
||||
if(!tags[i].component.empty())
|
||||
{
|
||||
strncpy(current_PIDs.APIDs[j].desc, tags[i].component.c_str(), DESC_MAX_LEN-1);
|
||||
if (current_PIDs.APIDs[j].is_ac3 && !strstr(current_PIDs.APIDs[j].desc, " (AC3)"))
|
||||
strncat(current_PIDs.APIDs[j].desc, " (AC3)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[j].desc)-1);
|
||||
else if (current_PIDs.APIDs[j].is_aac && !strstr(current_PIDs.APIDs[j].desc, " (AAC)"))
|
||||
strncat(current_PIDs.APIDs[j].desc, " (AAC)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[j].desc)-1);
|
||||
else if (current_PIDs.APIDs[j].is_eac3 && !strstr(current_PIDs.APIDs[j].desc, " (EAC3)"))
|
||||
strncat(current_PIDs.APIDs[j].desc, " (EAC3)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[j].desc)-1);
|
||||
std::string tmp_desc2 = tags[i].component.c_str();
|
||||
if (current_PIDs.APIDs[j].is_ac3 && tmp_desc2.find(" (AC3)"))
|
||||
tmp_desc2 += " (AC3)";
|
||||
else if (current_PIDs.APIDs[j].is_aac && tmp_desc2.find(" (AAC)"))
|
||||
tmp_desc2 += " (AAC)";
|
||||
else if (current_PIDs.APIDs[j].is_eac3 && tmp_desc2.find(" (EAC3)"))
|
||||
tmp_desc2 += " (EAC3)";
|
||||
|
||||
if(!tmp_desc2.empty()){
|
||||
strncpy(current_PIDs.APIDs[j].desc, tmp_desc2.c_str(), DESC_MAX_LEN -1);
|
||||
}
|
||||
}
|
||||
current_PIDs.APIDs[j].component_tag = -1;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user