Fix GH-46: gnupg_decrypt() segfault when password callback uid hint not supplied (#51)

This commit is contained in:
Jakub Zelenka 2025-03-18 17:47:27 +01:00 committed by GitHub
parent 473cfc78f7
commit 312655c7ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 179 additions and 3 deletions

View file

@ -732,6 +732,10 @@ gpgme_error_t passphrase_decrypt_cb (
GNUPG_ERR("Incorrent passphrase");
return 1;
}
if (uid_hint == NULL) {
GNUPG_ERR("No user ID hint");
return 1;
}
for (idx=0; idx < 16; idx++) {
uid[idx] = uid_hint[idx];
}