Unverified Commit 9780fd6b authored by Steven Fackler's avatar Steven Fackler Committed by GitHub
Browse files

Merge pull request #1152 from thomaswhiteway/ecdsa_sig_set0_leak

Free r and s on ECDSA_SIG before overwriting them in ECDSA_SIG_set0
parents 8b2c370b 106d6138
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -138,6 +138,11 @@ cfg_if! {
            r: *mut ffi::BIGNUM,
            s: *mut ffi::BIGNUM,
        ) -> c_int {
            if r.is_null() || s.is_null() {
                return 0;
            }
            ffi::BN_clear_free((*sig).r);
            ffi::BN_clear_free((*sig).s);
            (*sig).r = r;
            (*sig).s = s;
            1