Skip to content

Commit 52d9c30

Browse files
authored
Fix segfault when UserToken == nullptr (#7808)
1 parent 3d60e1e commit 52d9c30

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ydb/core/mon/async_http_mon.cpp

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

0 commit comments

Comments
 (0)