diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-10-15 00:58:09 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-10-15 00:58:09 +0000 |
commit | d95e0da764b8870a5c5278e7f2375c4adf92e4f4 (patch) | |
tree | c85fe2c53f6530e912e1ac8cd756ebcf3c226c53 /marshal.c | |
parent | ddeb0a4183c74637c23560c9c06c6470721019c9 (diff) |
* marshal.c (r_bytes0): check if source has enough data.
[ruby-dev:32054]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r-- | marshal.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -468,7 +468,7 @@ w_object(obj, arg, limit) return; } - if (ivtbl = rb_generic_ivar_table(obj)) { + if ((ivtbl = rb_generic_ivar_table(obj)) != 0) { w_byte(TYPE_IVAR, arg); } if (obj == Qnil) { @@ -873,7 +873,7 @@ r_bytes0(len, arg) if (len == 0) return rb_str_new(0, 0); if (TYPE(arg->src) == T_STRING) { - if (RSTRING(arg->src)->len > arg->offset) { + if (RSTRING(arg->src)->len > arg->offset + len) { str = rb_str_new(RSTRING(arg->src)->ptr+arg->offset, len); arg->offset += len; } |