Skip to content

Commit 4e979bb

Browse files
authored
Fix segfault when UserToken == nullptr (#7849)
1 parent aa5a493 commit 4e979bb

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ydb/core/mon/async_http_mon.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -373,13 +373,15 @@ class THttpMonLegacyActorRequest : public TActorBootstrapped<THttpMonLegacyActor
373373
return ReplyErrorAndPassAway(result);
374374
}
375375
bool found = false;
376-
for (const TString& sid : ActorMonPage->AllowedSIDs) {
377-
if (result.UserToken->IsExist(sid)) {
378-
found = true;
379-
break;
376+
if (result.UserToken) {
377+
for (const TString& sid : ActorMonPage->AllowedSIDs) {
378+
if (result.UserToken->IsExist(sid)) {
379+
found = true;
380+
break;
381+
}
380382
}
381383
}
382-
if (found || ActorMonPage->AllowedSIDs.empty()) {
384+
if (found || ActorMonPage->AllowedSIDs.empty() || !result.UserToken) {
383385
SendRequest(&result);
384386
} else {
385387
return ReplyForbiddenAndPassAway("SID is not allowed");

0 commit comments

Comments
 (0)