aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/model/GpgKey.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-04-12 11:47:01 +0000
committersaturneric <[email protected]>2025-04-12 11:47:01 +0000
commitb6e7eee4dfefb70505e29bd22d535ae1fcbed10c (patch)
treec7dc83074304d8df1232290905cc7757b6cb630a /src/core/model/GpgKey.cpp
parentrefactor: GpgKey and GpgSubKey (diff)
downloadGpgFrontend-b6e7eee4dfefb70505e29bd22d535ae1fcbed10c.tar.gz
GpgFrontend-b6e7eee4dfefb70505e29bd22d535ae1fcbed10c.zip
fix: avoid accessing invalid pointers of structs related to gpgme_key
Diffstat (limited to 'src/core/model/GpgKey.cpp')
-rw-r--r--src/core/model/GpgKey.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/model/GpgKey.cpp b/src/core/model/GpgKey.cpp
index 0c644217..6608d885 100644
--- a/src/core/model/GpgKey.cpp
+++ b/src/core/model/GpgKey.cpp
@@ -156,7 +156,7 @@ auto GpgKey::SubKeys() const -> QContainer<GpgSubKey> {
QContainer<GpgSubKey> ret;
auto *next = key_ref_->subkeys;
while (next != nullptr) {
- ret.push_back(GpgSubKey(next));
+ ret.push_back(GpgSubKey(key_ref_, next));
next = next->next;
}
return ret;
@@ -164,10 +164,10 @@ auto GpgKey::SubKeys() const -> QContainer<GpgSubKey> {
auto GpgKey::UIDs() const -> QContainer<GpgUID> {
QContainer<GpgUID> uids;
- auto *uid_next = key_ref_->uids;
- while (uid_next != nullptr) {
- uids.push_back(GpgUID(uid_next));
- uid_next = uid_next->next;
+ auto *next = key_ref_->uids;
+ while (next != nullptr) {
+ uids.push_back(GpgUID(key_ref_, next));
+ next = next->next;
}
return uids;
}
@@ -214,7 +214,7 @@ auto GpgKey::IsHasActualEncrCap() const -> bool {
}
auto GpgKey::PrimaryKey() const -> GpgSubKey {
- return GpgSubKey(key_ref_->subkeys);
+ return GpgSubKey(key_ref_, key_ref_->subkeys);
}
auto GpgKey::IsSubKey() const -> bool { return false; }