Fix segfault when using a blank or extremely short source parameter with external writer

This commit is contained in:
Thulinma 2024-05-07 12:44:07 +02:00
parent 78a30e212e
commit 729b75ac2a

View file

@ -864,7 +864,7 @@ pid_t Util::startPush(const std::string &streamname, std::string &target, int de
break; break;
} }
//Check for external writer support //Check for external writer support
if (front == "/" && back.size() && checkTarget.substr(checkTarget.size() - back.size()) == back){ if (front == "/" && back.size() && checkTarget.size() >= back.size() && checkTarget.substr(checkTarget.size() - back.size()) == back){
HTTP::URL tUri(target); HTTP::URL tUri(target);
// If it is a remote target, we might need to spawn an external binary // If it is a remote target, we might need to spawn an external binary
if (tUri.isLocalPath()){continue;} if (tUri.isLocalPath()){continue;}