SERVER-136202ClosedFixed

Potential null pointer dereference in document_source_list_local_sessions.cpp

I found a potential null pointer dereference in {{{}src/mongo/db/pipeline/document_source_list_local_sessions.cpp{}}}. [https://github.com/mongodb/mongo/blob/master/src/mongo/db/pipeline/document_source_list_local_sessions.cpp#L77-L102] In the {{listSessionsRequiredPrivileges}} function, the return value of {{Client::getCurrent()->getOperationContext()}} is passed to {{getUserNameForLoggedInUser()}} without being checked for nullptr: {{const auto& myName = getUserNameForLoggedInUse

Affected Versions
Versions known to exhibit this issue
8.0.9
Fixed Versions
Versions that include the fix
9.1.0-rc09.1.0-rc1025
Components
Server components related to this issue

No components specified.

Labels
Tags and classification
StaticCodeAnalsisqo-triage-week