diff options
author | Michal Rokos <m.rokos@sh.cvut.cz> | 2002-06-08 12:09:16 +0000 |
---|---|---|
committer | Michal Rokos <m.rokos@sh.cvut.cz> | 2002-06-08 12:09:16 +0000 |
commit | 7f555a0c638f1e6e625cc95c0f0c92147f467536 (patch) | |
tree | 46922c625487061817d9a03a16acc572354bbfda /ossl_cipher.c | |
parent | 03d676587fd7dc1577bccc14e9cf6bd8719fd001 (diff) | |
download | ruby-openssl-history-7f555a0c638f1e6e625cc95c0f0c92147f467536.tar.gz |
Cipher: fix fault in initialize (condition in GetCipher was too tight)
Diffstat (limited to 'ossl_cipher.c')
-rw-r--r-- | ossl_cipher.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ossl_cipher.c b/ossl_cipher.c index 181d657..8c3fe92 100644 --- a/ossl_cipher.c +++ b/ossl_cipher.c @@ -13,13 +13,16 @@ #define MakeCipher(obj, klass, ciphp) obj = Data_Make_Struct(klass, ossl_cipher, 0, ossl_cipher_free, ciphp) #define GetCipher(obj, ciphp) do { \ Data_Get_Struct(obj, ossl_cipher, ciphp); \ - if (!ciphp || !ciphp->cipher) { \ + if (!ciphp) { \ rb_raise(rb_eRuntimeError, "Cipher not inititalized!"); \ } \ } while (0) #define SafeGetCipher(obj, ciphp) do { \ OSSL_Check_Kind(obj, cCipher); \ GetCipher(obj, ciphp); \ + if (!ciphp->cipher) { \ + rb_raise(rb_eRuntimeError, "Cipher not inititalized!"); \ + } \ } while (0) /* |