mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
src/gui/movieplayer.cpp fix possible stack-buffer-overflow
This commit is contained in:
@@ -2307,12 +2307,13 @@ void CMoviePlayerGui::parsePlaylist(CFile *file)
|
|||||||
while (infile.good())
|
while (infile.good())
|
||||||
{
|
{
|
||||||
infile.getline(cLine, sizeof(cLine));
|
infile.getline(cLine, sizeof(cLine));
|
||||||
if (cLine[strlen(cLine)-1]=='\r')
|
size_t len = strlen(cLine);
|
||||||
cLine[strlen(cLine)-1]=0;
|
if (len > 0 && cLine[len-1]=='\r')
|
||||||
|
cLine[len-1]=0;
|
||||||
|
|
||||||
int dur;
|
int dur;
|
||||||
sscanf(cLine, "#EXTINF:%d,%[^\n]\n", &dur, name);
|
sscanf(cLine, "#EXTINF:%d,%[^\n]\n", &dur, name);
|
||||||
if (strlen(cLine) > 0 && cLine[0]!='#')
|
if (len > 0 && cLine[0]!='#')
|
||||||
{
|
{
|
||||||
char *url = NULL;
|
char *url = NULL;
|
||||||
if ((url = strstr(cLine, "http://")) || (url = strstr(cLine, "https://")) || (url = strstr(cLine, "rtmp://")) || (url = strstr(cLine, "rtsp://")) || (url = strstr(cLine, "mmsh://")) ) {
|
if ((url = strstr(cLine, "http://")) || (url = strstr(cLine, "https://")) || (url = strstr(cLine, "rtmp://")) || (url = strstr(cLine, "rtsp://")) || (url = strstr(cLine, "mmsh://")) ) {
|
||||||
|
Reference in New Issue
Block a user