diff options
author | saturneric <[email protected]> | 2025-04-12 11:47:01 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2025-04-12 11:47:01 +0000 |
commit | b6e7eee4dfefb70505e29bd22d535ae1fcbed10c (patch) | |
tree | c7dc83074304d8df1232290905cc7757b6cb630a /src/core/model/GpgSubKey.h | |
parent | refactor: GpgKey and GpgSubKey (diff) | |
download | GpgFrontend-b6e7eee4dfefb70505e29bd22d535ae1fcbed10c.tar.gz GpgFrontend-b6e7eee4dfefb70505e29bd22d535ae1fcbed10c.zip |
fix: avoid accessing invalid pointers of structs related to gpgme_key
Diffstat (limited to 'src/core/model/GpgSubKey.h')
-rw-r--r-- | src/core/model/GpgSubKey.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/model/GpgSubKey.h b/src/core/model/GpgSubKey.h index 255d209f..dc92ae1f 100644 --- a/src/core/model/GpgSubKey.h +++ b/src/core/model/GpgSubKey.h @@ -52,7 +52,8 @@ class GPGFRONTEND_CORE_EXPORT GpgSubKey : public GpgAbstractKey { * * @param subkey */ - explicit GpgSubKey(gpgme_subkey_t subkey); + explicit GpgSubKey(QSharedPointer<struct _gpgme_key> key_ref, + gpgme_subkey_t s_key); /** * @brief Construct a new Gpg Sub Key object @@ -234,7 +235,8 @@ class GPGFRONTEND_CORE_EXPORT GpgSubKey : public GpgAbstractKey { [[nodiscard]] auto SmartCardSerialNumber() -> QString; private: - gpgme_subkey_t subkey_ref_ = nullptr; ///< + QSharedPointer<struct _gpgme_key> key_ref_; + gpgme_subkey_t s_key_ref_ = nullptr; ///< }; } // namespace GpgFrontend |