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 | 5de7917c8e3014dfea6fa3efa88fc17049aff273 (patch) | |
tree | cfd202d18f09a8d0e26759143ae9eb23268ca095 /pack.c | |
parent | d2eea09f4a1f67faccac9c99bb1e54e49f3e507d (diff) |
* pack.c (pack_pack): pointer modification check before each
iteration. [ruby-dev:24445]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r-- | pack.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -464,6 +464,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; |