* 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
This commit is contained in:
parent
d2eea09f4a
commit
5de7917c8e
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Oct 8 09:49:32 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* pack.c (pack_pack): pointer modification check before each
|
||||||
|
iteration. [ruby-dev:24445]
|
||||||
|
|
||||||
Fri Oct 8 01:13:05 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
Fri Oct 8 01:13:05 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||||
|
|
||||||
* ext/tk/lib/tk/optiondb.rb: make it more secure
|
* ext/tk/lib/tk/optiondb.rb: make it more secure
|
||||||
|
|
3
pack.c
3
pack.c
|
@ -464,6 +464,9 @@ pack_pack(ary, fmt)
|
||||||
#define NEXTFROM (items-- > 0 ? RARRAY(ary)->ptr[idx++] : (rb_raise(rb_eArgError, toofew),0))
|
#define NEXTFROM (items-- > 0 ? RARRAY(ary)->ptr[idx++] : (rb_raise(rb_eArgError, toofew),0))
|
||||||
|
|
||||||
while (p < pend) {
|
while (p < pend) {
|
||||||
|
if (RSTRING(fmt)->ptr + RSTRING(fmt)->len != pend) {
|
||||||
|
rb_raise(rb_eRuntimeError, "format string modified");
|
||||||
|
}
|
||||||
type = *p++; /* get data type */
|
type = *p++; /* get data type */
|
||||||
#ifdef NATINT_PACK
|
#ifdef NATINT_PACK
|
||||||
natint = 0;
|
natint = 0;
|
||||||
|
|
Loading…
Reference in New Issue