mirror of
https://github.com/php-gnupg/php-gnupg.git
synced 2026-12-02 05:28:51 +00:00
Fix NULL user ID hint dereference in sign passphrase callback
This commit is contained in:
parent
de55676c6b
commit
b3f69f16da
1 changed files with 4 additions and 0 deletions
4
gnupg.c
4
gnupg.c
|
|
@ -672,6 +672,10 @@ gpgme_error_t passphrase_cb(
|
||||||
GNUPG_ERR("Incorrent passphrase");
|
GNUPG_ERR("Incorrent passphrase");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
if (uid_hint == NULL) {
|
||||||
|
GNUPG_ERR("No user ID hint");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
for (idx=0; idx < 16 && uid_hint[idx] != '\0'; idx++) {
|
for (idx=0; idx < 16 && uid_hint[idx] != '\0'; idx++) {
|
||||||
uid[idx] = uid_hint[idx];
|
uid[idx] = uid_hint[idx];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue