diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-10-08 03:36:54 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-10-08 03:36:54 +0000 |
commit | 89f2b4cb3b981374821b04ffd5592feed1022b87 (patch) | |
tree | 28585f0e2fab7921f475df3db56f86323acbd288 /pack.c | |
parent | 7f729119d4076e758bd9986b1d0366640bc9ac21 (diff) | |
download | ruby-89f2b4cb3b981374821b04ffd5592feed1022b87.tar.gz ruby-89f2b4cb3b981374821b04ffd5592feed1022b87.tar.xz ruby-89f2b4cb3b981374821b04ffd5592feed1022b87.zip |
* pack.c (pack_pack): pointer modification check before each
iteration. [ruby-dev:24445]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r-- | pack.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -499,6 +499,9 @@ pack_pack(ary, fmt) #define NEXTFROM (items-- > 0 ? RARRAY(ary)->ptr[idx++] : (rb_raise(rb_eArgError, toofew),0)) while (p < pend) { + if (RSTRING(fmt)->ptr + RSTRING(fmt)->len != pend) { + rb_raise(rb_eRuntimeError, "format string modified"); + } type = *p++; /* get data type */ #ifdef NATINT_PACK natint = 0; |