Skip to content

Commit a79e3cf

Browse files
committed
QLDoc scripts: Fix overly permissive regex ranges
The range `A-aa-z` was too permissive and includes special characters between `Z` and `a`. Low impact, but fix to address an internally reported code scanning alert.
1 parent 9a83005 commit a79e3cf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

config/opcode-qldoc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
start_qldoc_re = re.compile(r'^\s*/\*\*') # Start of a QLDoc comment
99
end_qldoc_re = re.compile(r'\*/\s*$') # End of a QLDoc comment
1010
blank_qldoc_line_re = re.compile(r'^\s*\*\s*$') # A line in a QLDoc comment with only the '*'
11-
instruction_class_re = re.compile(r'^class (?P<name>[A-aa-z0-9]+)Instruction\s') # Declaration of an `Instruction` class
12-
opcode_base_class_re = re.compile(r'^abstract class (?P<name>[A-aa-z0-9]+)Opcode\s') # Declaration of an `Opcode` base class
13-
opcode_class_re = re.compile(r'^ class (?P<name>[A-aa-z0-9]+)\s') # Declaration of an `Opcode` class
11+
instruction_class_re = re.compile(r'^class (?P<name>[A-Za-z0-9]+)Instruction\s') # Declaration of an `Instruction` class
12+
opcode_base_class_re = re.compile(r'^abstract class (?P<name>[A-Za-z0-9]+)Opcode\s') # Declaration of an `Opcode` base class
13+
opcode_class_re = re.compile(r'^ class (?P<name>[A-Za-z0-9]+)\s') # Declaration of an `Opcode` class
1414

1515
script_dir = path.realpath(path.dirname(__file__))
1616
instruction_path = path.realpath(path.join(script_dir, '../cpp/ql/src/semmle/code/cpp/ir/implementation/raw/Instruction.qll'))

0 commit comments

Comments
 (0)