提交 1a9553a1 编写于 作者: J Justin Collins

Fix handling negative indexes in array

especially empty arrays
上级 a87be61c
......@@ -450,7 +450,13 @@ class Brakeman::AliasProcessor < Brakeman::SexpProcessor
def process_array_access target, args
if args.length == 1 and integer? args[0]
index = args[0][1]
target[index + 1]
#Have to do this because first element is :array and we have to skip it
if index >= 0
target[index + 1]
else
target[index - 1]
end
else
nil
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册