Deny loading of streamnames > 100 characters.

This commit is contained in:
Thulinma 2015-03-12 11:33:34 +01:00
parent cfc6d9d6d3
commit fe08c8f5c7

View file

@ -71,6 +71,10 @@ void Util::sanitizeName(std::string & streamname) {
/// Starts a process for a VoD stream. /// Starts a process for a VoD stream.
bool Util::startInput(std::string streamname, std::string filename, bool forkFirst) { bool Util::startInput(std::string streamname, std::string filename, bool forkFirst) {
if (streamname.size() > 100){
FAIL_MSG("Stream opening denied: %s is longer than 100 characters (%lu).", streamname.c_str(), streamname.size());
return false;
}
IPC::sharedPage mistConfOut("!mistConfig", DEFAULT_CONF_PAGE_SIZE); IPC::sharedPage mistConfOut("!mistConfig", DEFAULT_CONF_PAGE_SIZE);
IPC::semaphore configLock("!mistConfLock", O_CREAT | O_RDWR, ACCESSPERMS, 1); IPC::semaphore configLock("!mistConfLock", O_CREAT | O_RDWR, ACCESSPERMS, 1);
configLock.wait(); configLock.wait();