From c3da7584b0d33b12e901a6da42a5ed8876758ede Mon Sep 17 00:00:00 2001 From: Alexey Khit Date: Mon, 14 Nov 2022 19:06:43 +0300 Subject: [PATCH] Add check on RTSP server requers with empty url path --- cmd/rtsp/rtsp.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/rtsp/rtsp.go b/cmd/rtsp/rtsp.go index 98c4c7d2..2da8b570 100644 --- a/cmd/rtsp/rtsp.go +++ b/cmd/rtsp/rtsp.go @@ -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)