ruby-changes:21714
From: nobu <ko1@a...>
Date: Tue, 15 Nov 2011 22:56:11 +0900 (JST)
Subject: [ruby-changes:21714] nobu:r33763 (trunk): * ext/openssl/ossl_asn1.c: get rid of potential overflow.
nobu 2011-11-15 22:55:38 +0900 (Tue, 15 Nov 2011) New Revision: 33763 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33763 Log: * ext/openssl/ossl_asn1.c: get rid of potential overflow. Modified files: trunk/ext/openssl/ossl_asn1.c Index: ext/openssl/ossl_asn1.c =================================================================== --- ext/openssl/ossl_asn1.c (revision 33762) +++ ext/openssl/ossl_asn1.c (revision 33763) @@ -331,7 +331,7 @@ * DER to Ruby converters */ static VALUE -decode_bool(unsigned char* der, int length) +decode_bool(unsigned char* der, long length) { int val; const unsigned char *p; @@ -344,7 +344,7 @@ } static VALUE -decode_int(unsigned char* der, int length) +decode_int(unsigned char* der, long length) { ASN1_INTEGER *ai; const unsigned char *p; @@ -363,7 +363,7 @@ } static VALUE -decode_bstr(unsigned char* der, int length, long *unused_bits) +decode_bstr(unsigned char* der, long length, long *unused_bits) { ASN1_BIT_STRING *bstr; const unsigned char *p; @@ -384,7 +384,7 @@ } static VALUE -decode_enum(unsigned char* der, int length) +decode_enum(unsigned char* der, long length) { ASN1_ENUMERATED *ai; const unsigned char *p; @@ -403,7 +403,7 @@ } static VALUE -decode_null(unsigned char* der, int length) +decode_null(unsigned char* der, long length) { ASN1_NULL *null; const unsigned char *p; @@ -417,7 +417,7 @@ } static VALUE -decode_obj(unsigned char* der, int length) +decode_obj(unsigned char* der, long length) { ASN1_OBJECT *obj; const unsigned char *p; @@ -446,7 +446,7 @@ } static VALUE -decode_time(unsigned char* der, int length) +decode_time(unsigned char* der, long length) { ASN1_TIME *time; const unsigned char *p; @@ -465,7 +465,7 @@ } static VALUE -decode_eoc(unsigned char *der, int length) +decode_eoc(unsigned char *der, long length) { if (length != 2 || !(der[0] == 0x00 && der[1] == 0x00)) ossl_raise(eASN1Error, NULL); @@ -777,7 +777,7 @@ } static VALUE -int_ossl_asn1_decode0_prim(unsigned char **pp, long length, int hlen, int tag, +int_ossl_asn1_decode0_prim(unsigned char **pp, long length, long hlen, int tag, VALUE tc, long *num_read) { VALUE value, asn1data; @@ -922,8 +922,8 @@ { unsigned char *start, *p; const unsigned char *p0; - long len = 0, inner_read = 0, off = *offset; - int hlen, tag, tc, j; + long len = 0, inner_read = 0, off = *offset, hlen; + int tag, tc, j; VALUE asn1data, tag_class; p = *pp; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/