From 45ca1d07546fb4f53dd28798c241b7b9b21aa43d Mon Sep 17 00:00:00 2001 From: gotoyuzo Date: Wed, 17 Sep 2003 09:40:17 +0000 Subject: should check retuen value of rb_protect. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/openssl/ossl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/openssl/ossl.c') diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c index f4a3fc4c99..9f605f0161 100644 --- a/ext/openssl/ossl.c +++ b/ext/openssl/ossl.c @@ -133,7 +133,7 @@ ossl_buf2str(char *buf, int len) int status = 0; str = rb_protect((VALUE(*)_(()))ossl_str_new, len, &status); - memcpy(RSTRING(str)->ptr, buf, len); + if(!NIL_P(str)) memcpy(RSTRING(str)->ptr, buf, len); OPENSSL_free(buf); if(status) rb_jump_tag(status); -- cgit v1.2.3