[macruby-changes] [4507] MacRuby/trunk/ext/openssl/ossl_asn1.c

source_changes at macosforge.org source_changes at macosforge.org
Sat Sep 11 01:39:02 PDT 2010


Revision: 4507
          http://trac.macosforge.org/projects/ruby/changeset/4507
Author:   lsansonetti at apple.com
Date:     2010-09-11 01:38:59 -0700 (Sat, 11 Sep 2010)
Log Message:
-----------
fix a crasher in ASN1::Constructive#to_der

Modified Paths:
--------------
    MacRuby/trunk/ext/openssl/ossl_asn1.c

Modified: MacRuby/trunk/ext/openssl/ossl_asn1.c
===================================================================
--- MacRuby/trunk/ext/openssl/ossl_asn1.c	2010-09-11 00:36:29 UTC (rev 4506)
+++ MacRuby/trunk/ext/openssl/ossl_asn1.c	2010-09-11 08:38:59 UTC (rev 4507)
@@ -971,8 +971,9 @@
 
     seq_len = ASN1_object_size(1, RSTRING_LEN(value), tag);
     length = ASN1_object_size(1, seq_len, tn);
-    str = rb_str_new(0, length);
-    p = (unsigned char *)RSTRING_PTR(str);
+    str = rb_bstr_new();
+    rb_bstr_resize(str, length);
+    p = (unsigned char *)rb_bstr_bytes(str);
     if(tc == V_ASN1_UNIVERSAL)
 	ASN1_put_object(&p, 1, RSTRING_LEN(value), tn, tc);
     else{
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100911/b6279a83/attachment-0001.html>


More information about the macruby-changes mailing list