Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

secretservice: fix null derefence on locked collections #356

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

WanzenBug
Copy link
Contributor

fixes #336

secret_item_get_secret() may return null if an item is locked or not loaded. While we set SECRET_SEARCH_LOAD_SECRETS and SECRET_SEARCH_UNLOCK, there may still be locked items, for example the user may refuse the unlock request.

So we still need to check if the secret data is NULL before we can try to reference it.

secret_item_get_secret() may return null if an item is locked or not loaded.
While we set SECRET_SEARCH_LOAD_SECRETS and SECRET_SEARCH_UNLOCK, there may
still be locked items, for example the user may refuse the unlock request.

So we still need to check if the secret data is NULL before we can try to
reference it.

Signed-off-by: Moritz "WanzenBug" Wanzenböck <moritz@wanzenbug.xyz>
@codecov-commenter
Copy link

codecov-commenter commented Feb 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.10%. Comparing base (1161e9c) to head (28e893e).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #356   +/-   ##
=======================================
  Coverage   53.10%   53.10%           
=======================================
  Files           9        9           
  Lines         676      676           
=======================================
  Hits          359      359           
  Misses        272      272           
  Partials       45       45           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@thaJeztah thaJeztah merged commit fc66c3f into docker:master Feb 27, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when attempting to access locked keyring via libsecret
4 participants