diff --git a/src/output/output_hls.cpp b/src/output/output_hls.cpp index 443f8e9f..f091dbdb 100644 --- a/src/output/output_hls.cpp +++ b/src/output/output_hls.cpp @@ -220,7 +220,14 @@ namespace Mist { std::string tmpStr = HTTP_R.getUrl(); std::string fmtStr = "/hls/" + streamName + "/%u_%u/%llu_%llu.ts"; long long unsigned int from; - sscanf(tmpStr.c_str(), fmtStr.c_str(), &vidTrack, &audTrack, &from, &until); + if (sscanf(tmpStr.c_str(), fmtStr.c_str(), &vidTrack, &audTrack, &from, &until) != 4){ + WARN_MSG("Could not parse URL: %s", HTTP_R.getUrl().c_str()); + HTTP_S.Clean(); + HTTP_S.SetBody("The HLS URL wasn't understood - what did you want, exactly?\n"); + myConn.SendNow(HTTP_S.BuildResponse("404", "URL mismatch")); + HTTP_R.Clean(); //clean for any possible next requests + continue; + } DEBUG_MSG(DLVL_DEVEL, "Vid %u, Aud %u, From %llu, Until %llu", vidTrack, audTrack, from, until); selectedTracks.clear(); selectedTracks.insert(vidTrack);