Skip to content

Commit

Permalink
feat(checker): Add Lua Checker (intel#1257)
Browse files Browse the repository at this point in the history
  • Loading branch information
BreadGenie authored and peb-peb committed Aug 2, 2021
1 parent 117e325 commit 77e9021
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions cve_bin_tool/checkers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"libxslt",
"lighttpd",
"logrotate",
"lua",
"mariadb",
"memcached",
"mysql",
Expand Down
21 changes: 21 additions & 0 deletions cve_bin_tool/checkers/lua.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: GPL-3.0-or-later


"""
CVE checker for lua
https://www.cvedetails.com/product/28436/?q=LUA
"""
from cve_bin_tool.checkers import Checker


class LuaChecker(Checker):
CONTAINS_PATTERNS = [
r"PANIC: unprotected error in call to Lua API \(%s\)",
r"-o name output to file `name' \(default is \"luac.out\"\)",
]
FILENAME_PATTERNS = [r"lua"]
VERSION_PATTERNS = [r"Lua ([0-9]+\.[0-9]+\.[0-9]+)"]
VENDOR_PRODUCT = [("lua", "lua")]
Binary file not shown.
Binary file not shown.
37 changes: 37 additions & 0 deletions test/test_data/lua.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{
"product": "lua",
"version": "5.1.5",
"version_strings": [
"Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio",
"PANIC: unprotected error in call to Lua API (%s)",
'-o name output to file `name\' (default is "luac.out")',
],
},
{
"product": "lua",
"version": "5.0.3",
"version_strings": [
"Lua 5.0.3 Copyright (C) 1994-2006 Tecgraf, PUC-Rio",
"PANIC: unprotected error in call to Lua API (%s)",
'-o name output to file `name\' (default is "luac.out")',
],
},
]
package_test_data = [
{
"url": "https://ftp.lysator.liu.se/pub/opensuse/tumbleweed/repo/oss/x86_64/",
"package_name": "lua51-5.1.5-15.11.x86_64.rpm",
"product": "lua",
"version": "5.1.5",
},
{
"url": "http://ports.ubuntu.com/pool/universe/l/lua50/",
"package_name": "lua50_5.0.3-8_arm64.deb",
"product": "lua",
"version": "5.0.3",
},
]

0 comments on commit 77e9021

Please sign in to comment.