Revision
3209
Author
lsansonetti@apple.com
Date
2010-01-07 21:27:46 -0800 (Thu, 07 Jan 2010)

Log Message

temporary fix for potential #caller out of bounds access

Modified Paths

Diff

Modified: MacRuby/trunk/lib/rss/utils.rb (3208 => 3209)


--- MacRuby/trunk/lib/rss/utils.rb	2010-01-08 04:45:43 UTC (rev 3208)
+++ MacRuby/trunk/lib/rss/utils.rb	2010-01-08 05:27:46 UTC (rev 3209)
@@ -10,7 +10,9 @@
     end
     
     def get_file_and_line_from_caller(i=0)
-      file, line, = caller[i].split(':')
+      bt = caller
+      i = bt.size - 1 if i >= bt.size
+      file, line, = bt[i].split(':')
       line = line.to_i
       line += 1 if i.zero?
       [file, line]