service: prevent nil deref in validate with wrapped join request (#4547)

When a client hits /rtc/v[01]/validate with a base64 WrappedJoinRequest
whose embedded JoinRequest.ClientInfo is unset, validateInternal called
AugmentClientInfo with a nil *ClientInfo and panicked at ci.Address =
GetClientIP(req). The non-wrapped branch already allocates via
ParseClientInfo; do the same here so pi.Client always gets at least the
resolved client Address.
This commit is contained in:
Paul Wells
2026-05-26 08:34:15 -07:00
committed by GitHub
parent dd7580b454
commit 222177a9e4
+3
View File
@@ -254,6 +254,9 @@ func (s *RTCService) validateInternal(
} else {
lgr.Debugw("processing join request", "joinRequest", logger.Proto(joinRequest))
if joinRequest.ClientInfo == nil {
joinRequest.ClientInfo = &livekit.ClientInfo{}
}
AugmentClientInfo(joinRequest.ClientInfo, r)
pi.Client = joinRequest.ClientInfo