Add check on RTSP server requers with empty url path

This commit is contained in:
Alexey Khit
2022-11-14 19:06:43 +03:00
parent 1e247cba92
commit c3da7584b0

View File

@@ -140,6 +140,11 @@ func tcpHandler(c net.Conn) {
switch msg {
case rtsp.MethodDescribe:
if len(conn.URL.Path) == 0 {
log.Warn().Msg("[rtsp] server empty URL on DESCRIBE")
return
}
name = conn.URL.Path[1:]
stream := streams.Get(name)
@@ -161,6 +166,11 @@ func tcpHandler(c net.Conn) {
}
case rtsp.MethodAnnounce:
if len(conn.URL.Path) == 0 {
log.Warn().Msg("[rtsp] server empty URL on ANNOUNCE")
return
}
name = conn.URL.Path[1:]
stream := streams.Get(name)