[前][次][番号順一覧][スレッド一覧]

ruby-changes:33620

From: nobu <ko1@a...>
Date: Thu, 24 Apr 2014 11:53:35 +0900 (JST)
Subject: [ruby-changes:33620] nobu:r45701 (trunk): ossl_asn1.c: fix undefined behavior

nobu	2014-04-24 11:53:29 +0900 (Thu, 24 Apr 2014)

  New Revision: 45701

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45701

  Log:
    ossl_asn1.c: fix undefined behavior
    
    * ext/openssl/ossl_asn1.c (ossl_asn1_initialize): SYMID on a value
      other than Symbol is an undefined behavior.  fix up r31699.
      [ruby-core:62142] [Bug #9771]

  Modified files:
    trunk/ChangeLog
    trunk/ext/openssl/ossl_asn1.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45700)
+++ ChangeLog	(revision 45701)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Apr 24 11:53:28 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* ext/openssl/ossl_asn1.c (ossl_asn1_initialize): SYMID on a value
+	  other than Symbol is an undefined behavior.  fix up r31699.
+	  [ruby-core:62142] [Bug #9771]
+
 Thu Apr 24 11:21:37 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (rb_sym2id, rb_sym2id_without_pindown): return 0 for
Index: ext/openssl/ossl_asn1.c
===================================================================
--- ext/openssl/ossl_asn1.c	(revision 45700)
+++ ext/openssl/ossl_asn1.c	(revision 45701)
@@ -1150,7 +1150,7 @@ ossl_asn1_initialize(int argc, VALUE *ar https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_asn1.c#L1150
 	}
 	if(!SYMBOL_P(tag_class))
 	    ossl_raise(eASN1Error, "invalid tag class");
-	if(SYM2ID(tagging) == sIMPLICIT && NUM2INT(tag) > 31)
+	if(!NIL_P(tagging) && SYM2ID(tagging) == sIMPLICIT && NUM2INT(tag) > 31)
 	    ossl_raise(eASN1Error, "tag number for Universal too large");
     }
     else{

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]