From 43754528668aafaa2f6dddaa06fdf8fbed6d3cd8 Mon Sep 17 00:00:00 2001 From: Alex Ford Date: Thu, 29 Apr 2021 17:08:33 +0100 Subject: [PATCH] more IntegerLiteral.getValue improvements --- ql/src/codeql_ruby/ast/Literal.qll | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ql/src/codeql_ruby/ast/Literal.qll b/ql/src/codeql_ruby/ast/Literal.qll index a169c4f3780..fbf06f0e8cb 100644 --- a/ql/src/codeql_ruby/ast/Literal.qll +++ b/ql/src/codeql_ruby/ast/Literal.qll @@ -49,22 +49,22 @@ class IntegerLiteral extends NumericLiteral, TIntegerLiteral { final int getValue() { exists(string s, string values, string str | - s = this.getValueText() and + s = this.getValueText().toLowerCase() and ( - (s.matches("0b%") or s.matches("0B%")) and + s.matches("0b%") and values = "01" and str = s.suffix(2) or - (s.matches("0x%") or s.matches("0X%")) and + s.matches("0x%") and values = "0123456789abcdef" and str = s.suffix(2) or s.charAt(0) = "0" and - not s.charAt(1) = ["b", "B", "x", "X"] and + not s.charAt(1) = ["b", "x", "o"] and values = "01234567" and str = s.suffix(1) or - (s.matches("0o%") or s.matches("0O%")) and + s.matches("0o%") and values = "01234567" and str = s.suffix(2) or