From bc02163c1c2ce96bf50e1ab8ed81b55b01ec2d7a Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Fri, 24 May 2013 16:58:59 +0200 Subject: [PATCH] audioplayer: avoid out-of-bounds access Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ca3e06b3fc640b7e931ded5f857611317624870b Author: Stefan Seyfried Date: 2013-05-24 (Fri, 24 May 2013) --- src/gui/audioplayer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 62ee66195..4ccd13961 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1346,13 +1346,13 @@ bool CAudioPlayerGui::openFilebrowser(void) while (infile.good()) { infile.getline(cLine, 255); - // remove CR - if (cLine[strlen(cLine)-1]=='\r') - cLine[strlen(cLine)-1]=0; int duration; sscanf(cLine, "#EXTINF:%d,%[^\n]\n", &duration, name); if (strlen(cLine) > 0 && cLine[0]!='#') { + // remove CR + if (cLine[strlen(cLine)-1]=='\r') + cLine[strlen(cLine)-1]=0; char *url = strstr(cLine, "http://"); if (url != NULL) { if (strstr(url, ".m3u") || strstr(url, ".pls"))