diff options
author | Neal H. Walfield <[email protected]> | 2015-12-02 14:20:18 +0000 |
---|---|---|
committer | Neal H. Walfield <[email protected]> | 2015-12-02 14:21:57 +0000 |
commit | c73d75103cbd34975e2bd28e9924caee05eaf829 (patch) | |
tree | 2f74753518c49b4d8e405680d9687197507dbd3f | |
parent | dirmngr: Switch to an onion address if Tor is running. (diff) | |
download | gnupg-c73d75103cbd34975e2bd28e9924caee05eaf829.tar.gz gnupg-c73d75103cbd34975e2bd28e9924caee05eaf829.zip |
gpg: Fix type mismatch resulting in a buffer overflow.
* g10/tofu.c (record_binding): Change policy_old's type from an enum
tofu_policy to a long: this variable is passed by reference and a long
is expected.
--
Signed-off-by: Neal H. Walfield <[email protected]>
Reported-by: Justus Winter <[email protected]>
Fixes-commit: f77913e
-rw-r--r-- | g10/tofu.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/g10/tofu.c b/g10/tofu.c index d340bfeb1..2433b7b4e 100644 --- a/g10/tofu.c +++ b/g10/tofu.c @@ -1079,7 +1079,10 @@ record_binding (struct dbs *dbs, const char *fingerprint, const char *email, struct db *db_email = NULL, *db_key = NULL; int rc; char *err = NULL; - enum tofu_policy policy_old = TOFU_POLICY_NONE; + /* policy_old needs to be a long and not an enum tofu_policy, + because we pass it by reference to get_single_long_cb2, which + expects a long. */ + long policy_old = TOFU_POLICY_NONE; if (! (policy == TOFU_POLICY_AUTO || policy == TOFU_POLICY_GOOD |