$NetBSD: patch-be,v 1.1 2005/11/02 08:56:40 taca Exp $

--- ext/openssl/ossl_cipher.c.orig	2005-02-28 11:45:17.000000000 +0900
+++ ext/openssl/ossl_cipher.c
@@ -224,7 +224,8 @@ ossl_cipher_update(VALUE self, VALUE dat
 
     StringValue(data);
     in = RSTRING(data)->ptr;
-    in_len = RSTRING(data)->len;
+    if ((in_len = RSTRING(data)->len) == 0)
+	rb_raise(rb_eArgError, "data must not be empty");
     GetCipher(self, ctx);
     str = rb_str_new(0, in_len+EVP_CIPHER_CTX_block_size(ctx));
     if (!EVP_CipherUpdate(ctx, RSTRING(str)->ptr, &out_len, in, in_len))
