]> wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - gost_grasshopper_cipher.c
Update comment to match reality
[openssl-gost/engine.git] / gost_grasshopper_cipher.c
index e78fae747db56dca65fc677e00a7b4d27425afbd..a482a39cf0728ea2bf75746109cfe8aa85708293 100644 (file)
@@ -604,6 +604,10 @@ int gost_grasshopper_cipher_do_cfb(EVP_CIPHER_CTX* ctx, unsigned char* out,
 
 int gost_grasshopper_cipher_cleanup(EVP_CIPHER_CTX* ctx) {
     gost_grasshopper_cipher_ctx* c = (gost_grasshopper_cipher_ctx*) EVP_CIPHER_CTX_get_cipher_data(ctx);
+
+    if (!c)
+        return 1;
+
     struct GRASSHOPPER_CIPHER_PARAMS* params = &gost_cipher_params[c->type];
 
     gost_grasshopper_cipher_destroy(c);