From 8df10bbe16fecde7aa94b69544b366a153cde395 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/6148b976aa79c40d200f8b314b241365030d20eb 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 60786ca62..202480188 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1343,13 +1343,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"))