[#35446] [Ruby 1.9 - Bug #4477][Open] Kernel:exec and backtick (`) don't work for certain system commands — Joachim Wuttke <j.wuttke@...>

10 messages 2011/03/07

[#35476] [Ruby 1.9 - Bug #4489][Open] [PATCH] Encodings with /-(unix|dos|mac)\Z/ — "James M. Lawrence" <quixoticsycophant@...>

20 messages 2011/03/10

[#35552] [Ruby 1.9 - Feature #4523][Open] Kernel#require to return the path of the loaded file — Alex Young <alex@...>

14 messages 2011/03/24

[#35565] [Ruby 1.9 - Feature #4531][Open] [PATCH 0/7] use poll() instead of select() in certain cases — Eric Wong <normalperson@...>

33 messages 2011/03/28

[#35566] [Ruby 1.9 - Feature #4532][Open] [PATCH] add IO#pread and IO#pwrite methods — Eric Wong <normalperson@...>

12 messages 2011/03/28

[#35586] [Ruby 1.9 - Feature #4538][Open] [PATCH (cleanup)] avoid unnecessary select() calls before doing I/O — Eric Wong <normalperson@...>

9 messages 2011/03/29

[ruby-core:35413] [Ruby 1.9 - Bug #4451] Date#step does not raise ArgumentError for 0 step

From: tadayoshi funaba <redmine@...>
Date: 2011-03-02 11:42:28 UTC
List: ruby-core #35413
Issue #4451 has been updated by tadayoshi funaba.

Priority changed from Normal to Low

you are not right.
the intention of comment outed code is different.

i have a doubt about Numeric's one.
firstly, i think the current behaviour of date's one is not wrong.
however, i believe it should raise error soon if it should be an error.
but Numeric's one is not.

 > a = 1.step(1,0)
 #=> #<Enumerator: 1:step(1, 0)>
 > a.each{}
 ArgumentError: step can't be 0
 	from (irb):3:in `step'
 	from (irb):3:in `each'
 	from (irb):3
 	from ./bin/irb:12:in `<main>'

i once asked and proposed this.
however, i don't still get any answers.
so the change has been frozen.

i don't understand why Numeric#step delay the raise.
----------------------------------------
Bug #4451: Date#step does not raise ArgumentError for 0 step
http://redmine.ruby-lang.org/issues/4451

Author: Jeremy Evans
Status: Open
Priority: Low
Assignee: tadayoshi funaba
Category: lib
Target version: 
ruby -v: ruby 1.9.3dev (2011-02-16 trunk 30888) [x86_64-openbsd4.9]


Numeric#step:

$ ruby -e '1.step(2, 0){}'
-e:1:in `step': step can't be 0 (ArgumentError)
        from -e:1:in `<main>'

Range#step:

$ ruby -r date -e '(0..1).step(0){}'
-e:1:in `step': step can't be 0 (ArgumentError)
        from -e:1:in `<main>'

Date#step:

ruby -r date -e 'Date.today.step(Date.today, 0){}'
# infinite loop

There is already a check for this in date.rb, but it is commented out.  It was added in r13408, over 3 years ago.  The lack of this check can cause a denial of service if the step value is controlled by the attacker.  The attached patch enables the check and adds a test for it.


-- 
http://redmine.ruby-lang.org

In This Thread

Prev Next