summaryrefslogtreecommitdiff
path: root/ext/nkf
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-21 10:11:44 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-21 10:11:44 +0000
commit6d1940fed99ae106c4bbaaf22c9d41872e9e9de0 (patch)
tree98926b03811229bf2c7c34371cea6cf7b4bafe31 /ext/nkf
parentca3f208b3b63bc73f12e1dda6aad4abea1055c07 (diff)
* ext/nkf/nkf.c (rb_nkf_convert, rb_nkf_guess): check too huge
string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/nkf')
-rw-r--r--ext/nkf/nkf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/nkf/nkf.c b/ext/nkf/nkf.c
index 1eb4104..05fd36d 100644
--- a/ext/nkf/nkf.c
+++ b/ext/nkf/nkf.c
@@ -155,12 +155,12 @@ rb_nkf_convert(VALUE obj, VALUE opt, VALUE src)
input_ctr = 0;
StringValue(src);
input = (unsigned char *)RSTRING_PTR(src);
- i_len = RSTRING_LEN(src);
+ i_len = RSTRING_LENINT(src);
tmp = result = rb_str_new(0, i_len*3 + 10);
output_ctr = 0;
output = (unsigned char *)RSTRING_PTR(result);
- o_len = RSTRING_LEN(result);
+ o_len = RSTRING_LENINT(result);
*output = '\0';
kanji_convert(NULL);
@@ -192,7 +192,7 @@ rb_nkf_guess(VALUE obj, VALUE src)
input_ctr = 0;
StringValue(src);
input = (unsigned char *)RSTRING_PTR(src);
- i_len = RSTRING_LEN(src);
+ i_len = RSTRING_LENINT(src);
guess_f = TRUE;
kanji_convert( NULL );