Skip to content
Commit 4751815c authored by Igor Kushnir's avatar Igor Kushnir 💬
Browse files

SessionLock: assert valid session id string

The default string representation of a QUuid is enclosed in curly
braces. dBusServiceNameForSession() calls QStringView::mid() assuming
such a default UUID string representation. One of the callers of this
function - SessionLock::handleLockedSession() - does always pass the
result of a QUuid::toString() call. The other two callers of
dBusServiceNameForSession() apparently assume the same session id string
format.

QStringView::mid() will be ported to QStringView::sliced() once KDevelop
depends on Qt 6. The behavior is undefined if the second argument to
sliced() is negative.

Assert the string format assumption in dBusServiceNameForSession() to
better document it and catch a potential bug earlier.
parent a8219e2b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment