Class: Zoom::SecurityProfile::UnsafeC

Inherits:
Zoom::SecurityProfile show all
Defined in:
lib/zoom/profile/unsafe_c.rb

Instance Attribute Summary

Attributes inherited from Profile

#exts, #files, #format_flags, #regex, #taggable

Instance Method Summary collapse

Methods inherited from Zoom::SecurityProfile

#after, #before, #exe, #flags, #grep_like_format_flags, #only_exts_and_files, #preprocess, #tool, #translate

Methods inherited from Profile

#after, #before, #class_name, #exe, #flags, from_json, #grep_like_format_flags, #grep_like_tags?, #name, #only_exts_and_files, #preprocess, profile_by_name, subclasses, #to_s, #tool, #translate

Constructor Details

#initialize(n = nil, t = nil, f = nil, b = nil, a = nil) ⇒ UnsafeC

Returns a new instance of UnsafeC.



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/zoom/profile/unsafe_c.rb', line 2

def initialize(n = nil, t = nil, f = nil, b = nil, a = nil)
    t = Zoom::ProfileManager.default_tool

    super(n, t, f, b, a)
    @exts = [
        "C",
        "c",
        "cc",
        "cpp",
        "cxx",
        "H",
        "h",
        "hh",
        "hpp",
        "hxx",
        "m",
        "tpp",
        "xs"
    ]
    functions = [
        "_splitpath",
        "ato[fil]",
        "gets",
        "makepath",
        "popen",
        "(sn?)?scanf",
        "str(cat|cpy|len)",
        "v?sprintf"
    ]
    start_or_not_variable = "(^|[^\\nA-Za-z_])"
    @regex = [
        start_or_not_variable,
        "(#{functions.join("|")})\\(",
    ].join
end