mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
audioplayer: avoid out-of-bounds access
This commit is contained in:
committed by
Jacek Jendrzej
parent
860443c4e3
commit
ca3e06b3fc
@@ -1346,13 +1346,13 @@ bool CAudioPlayerGui::openFilebrowser(void)
|
|||||||
while (infile.good())
|
while (infile.good())
|
||||||
{
|
{
|
||||||
infile.getline(cLine, 255);
|
infile.getline(cLine, 255);
|
||||||
// remove CR
|
|
||||||
if (cLine[strlen(cLine)-1]=='\r')
|
|
||||||
cLine[strlen(cLine)-1]=0;
|
|
||||||
int duration;
|
int duration;
|
||||||
sscanf(cLine, "#EXTINF:%d,%[^\n]\n", &duration, name);
|
sscanf(cLine, "#EXTINF:%d,%[^\n]\n", &duration, name);
|
||||||
if (strlen(cLine) > 0 && cLine[0]!='#')
|
if (strlen(cLine) > 0 && cLine[0]!='#')
|
||||||
{
|
{
|
||||||
|
// remove CR
|
||||||
|
if (cLine[strlen(cLine)-1]=='\r')
|
||||||
|
cLine[strlen(cLine)-1]=0;
|
||||||
char *url = strstr(cLine, "http://");
|
char *url = strstr(cLine, "http://");
|
||||||
if (url != NULL) {
|
if (url != NULL) {
|
||||||
if (strstr(url, ".m3u") || strstr(url, ".pls"))
|
if (strstr(url, ".m3u") || strstr(url, ".pls"))
|
||||||
|
Reference in New Issue
Block a user