Commit 066be5de by Thomas Barabosch

Fixed many issues due to pre-commit

parent 75c0712e
{ {
"CWE190": { "CWE190": {
"symbols": ["xmalloc", "malloc", "realloc"] "symbols": [
"xmalloc",
"malloc",
"realloc"
]
}, },
"CWE215": { "CWE215": {
"symbols": [] "symbols": []
}, },
"CWE243": { "CWE243": {
"pairs": [["chroot", "chdir"], ["chdir", "chroot", "setresuid"], ["chdir", "chroot", "seteuid"], "_comment": "valid chroot pathes according to http://www.unixwiz.net/techtips/chroot-practices.html",
["chdir", "chroot", "setreuid"], ["chdir", "chroot", "setuid"]], "pairs": [
"_comment": "valid chroot pathes according to http://www.unixwiz.net/techtips/chroot-practices.html" [
"chroot",
"chdir"
],
[
"chdir",
"chroot",
"setresuid"
],
[
"chdir",
"chroot",
"seteuid"
],
[
"chdir",
"chroot",
"setreuid"
],
[
"chdir",
"chroot",
"setuid"
]
]
}, },
"CWE248": { "CWE248": {
"symbols": [] "symbols": []
}, },
"CWE332": { "CWE332": {
"pairs": [["srand", "rand"]] "pairs": [
[
"srand",
"rand"
]
]
}, },
"CWE367": { "CWE367": {
"pairs": [["access", "open"]] "pairs": [
[
"access",
"open"
]
]
}, },
"CWE426": { "CWE426": {
"symbols": ["setresgid", "setresuid", "setuid", "setgid", "seteuid", "setegid"], "_comment": "functions that change/drop privileges",
"_comment": "functions that change/drop privileges" "symbols": [
"setresgid",
"setresuid",
"setuid",
"setgid",
"seteuid",
"setegid"
]
}, },
"CWE457": { "CWE457": {
"symbols": [] "symbols": []
}, },
"CWE467": { "CWE467": {
"symbols": ["strncmp", "malloc", "_comment": "any function that takes something of type size_t could be a possible candidate.",
"alloca", "_alloca", "strncat", "wcsncat", "symbols": [
"strncpy", "wcsncpy", "stpncpy", "wcpncpy", "strncmp",
"memcpy", "wmemcpy", "memmove", "wmemmove", "memcmp", "wmemcmp"], "malloc",
"_comment": "any function that takes something of type size_t could be a possible candidate." "alloca",
"_alloca",
"strncat",
"wcsncat",
"strncpy",
"wcsncpy",
"stpncpy",
"wcpncpy",
"memcpy",
"wmemcpy",
"memmove",
"wmemmove",
"memcmp",
"wmemcmp"
]
}, },
"CWE476": { "CWE476": {
"symbols": ["malloc", "calloc", "realloc", "getenv", "bsearch", "setlocale", "tmpfile", "tmpnam",
"fopen", "freopen", "fgets", "memchr", "strchr", "strpbrk", "strrchr", "strstr", "strtok",
"fgetws", "wcschr", "wcspbrk", "wcsrchr", "wcsstr", "wcstok", "wmemchr"],
"_comment": "any function that possibly returns a NULL value.", "_comment": "any function that possibly returns a NULL value.",
"_comment1": "included functions of the following libs: stdlib.h, locale.h, stdio.h, cstring.h, wchar.h" "_comment1": "included functions of the following libs: stdlib.h, locale.h, stdio.h, cstring.h, wchar.h",
"symbols": [
"malloc",
"calloc",
"realloc",
"getenv",
"bsearch",
"setlocale",
"tmpfile",
"tmpnam",
"fopen",
"freopen",
"fgets",
"memchr",
"strchr",
"strpbrk",
"strrchr",
"strstr",
"strtok",
"fgetws",
"wcschr",
"wcspbrk",
"wcsrchr",
"wcsstr",
"wcstok",
"wmemchr"
]
}, },
"CWE676": { "CWE676": {
"_comment": "https://github.com/01org/safestringlib/wiki/SDL-List-of-Banned-Functions", "_comment": "https://github.com/01org/safestringlib/wiki/SDL-List-of-Banned-Functions",
"symbols": ["alloca", "_alloca", "symbols": [
"scanf", "wscanf", "sscanf", "swscanf", "vscanf", "vsscanf", "alloca",
"strlen", "wcslen", "strtok", "strtok_r", "wcstok", "_alloca",
"strcat", "strncat", "wcscat", "wcsncat", "scanf",
"strcpy", "strncpy", "wcscpy", "wcsncpy", "stpcpy", "stpncpy", "wcpcpy", "wcpncpy", "wscanf",
"memcpy", "wmemcpy", "memmove", "wmemmove", "memcmp", "wmemcmp", "me​mset", "wmemset", "sscanf",
"gets", "sprintf​", "vsprintf", "swprintf", "vswprintf", "snprintf", "vsnprintf", "swscanf",
"realpath", "getwd", "wctomb", "wcrtomb", "wcstombs", "wcsrtombs", "wcsnrtombs"] "vscanf",
"vsscanf",
"strlen",
"wcslen",
"strtok",
"strtok_r",
"wcstok",
"strcat",
"strncat",
"wcscat",
"wcsncat",
"strcpy",
"strncpy",
"wcscpy",
"wcsncpy",
"stpcpy",
"stpncpy",
"wcpcpy",
"wcpncpy",
"memcpy",
"wmemcpy",
"memmove",
"wmemmove",
"memcmp",
"wmemcmp",
"me\u200bmset",
"wmemset",
"gets",
"sprintf\u200b",
"vsprintf",
"swprintf",
"vswprintf",
"snprintf",
"vsnprintf",
"realpath",
"getwd",
"wctomb",
"wcrtomb",
"wcstombs",
"wcsrtombs",
"wcsnrtombs"
]
}, },
"CWE782": { "CWE782": {
"symbols": [] "symbols": []
} }
} }
import unittest import unittest
import cwe_checker_testlib import cwe_checker_testlib
class TestCwe190(unittest.TestCase): class TestCwe190(unittest.TestCase):
def setUp(self): def setUp(self):
...@@ -32,4 +33,3 @@ class TestCwe190(unittest.TestCase): ...@@ -32,4 +33,3 @@ class TestCwe190(unittest.TestCase):
expect_res = 3 expect_res = 3
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res assert res == expect_res
import unittest import unittest
import cwe_checker_testlib import cwe_checker_testlib
class TestCwe215(unittest.TestCase): class TestCwe215(unittest.TestCase):
def setUp(self): def setUp(self):
......
import unittest import unittest
import cwe_checker_testlib import cwe_checker_testlib
class TestCwe243(unittest.TestCase): class TestCwe243(unittest.TestCase):
def setUp(self): def setUp(self):
......
import unittest import unittest
import cwe_checker_testlib import cwe_checker_testlib
class TestCwe248(unittest.TestCase): class TestCwe248(unittest.TestCase):
def setUp(self): def setUp(self):
...@@ -33,4 +34,3 @@ class TestCwe248(unittest.TestCase): ...@@ -33,4 +34,3 @@ class TestCwe248(unittest.TestCase):
expect_res = 2 expect_res = 2
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res assert res == expect_res
import unittest import unittest
import cwe_checker_testlib import cwe_checker_testlib
class TestCwe332(unittest.TestCase): class TestCwe332(unittest.TestCase):
def setUp(self): def setUp(self):
...@@ -32,4 +33,3 @@ class TestCwe332(unittest.TestCase): ...@@ -32,4 +33,3 @@ class TestCwe332(unittest.TestCase):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res assert res == expect_res
import unittest import unittest
import cwe_checker_testlib import cwe_checker_testlib
class TestCwe367(unittest.TestCase): class TestCwe367(unittest.TestCase):
def setUp(self): def setUp(self):
...@@ -32,4 +33,3 @@ class TestCwe367(unittest.TestCase): ...@@ -32,4 +33,3 @@ class TestCwe367(unittest.TestCase):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res assert res == expect_res
import unittest import unittest
import cwe_checker_testlib import cwe_checker_testlib
class TestCwe426(unittest.TestCase): class TestCwe426(unittest.TestCase):
def setUp(self): def setUp(self):
...@@ -33,4 +34,3 @@ class TestCwe426(unittest.TestCase): ...@@ -33,4 +34,3 @@ class TestCwe426(unittest.TestCase):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res assert res == expect_res
import unittest import unittest
import cwe_checker_testlib import cwe_checker_testlib
class TestCwe457(unittest.TestCase): class TestCwe457(unittest.TestCase):
def setUp(self): def setUp(self):
...@@ -36,4 +37,3 @@ class TestCwe457(unittest.TestCase): ...@@ -36,4 +37,3 @@ class TestCwe457(unittest.TestCase):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res assert res == expect_res
import unittest import unittest
import cwe_checker_testlib import cwe_checker_testlib
class TestCwe467(unittest.TestCase): class TestCwe467(unittest.TestCase):
def setUp(self): def setUp(self):
...@@ -33,4 +34,3 @@ class TestCwe467(unittest.TestCase): ...@@ -33,4 +34,3 @@ class TestCwe467(unittest.TestCase):
expect_res = 2 expect_res = 2
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res assert res == expect_res
import unittest import unittest
import cwe_checker_testlib import cwe_checker_testlib
class TestCwe476(unittest.TestCase): class TestCwe476(unittest.TestCase):
def setUp(self): def setUp(self):
...@@ -33,4 +34,3 @@ class TestCwe476(unittest.TestCase): ...@@ -33,4 +34,3 @@ class TestCwe476(unittest.TestCase):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res assert res == expect_res
import unittest import unittest
import cwe_checker_testlib import cwe_checker_testlib
class TestCwe676(unittest.TestCase): class TestCwe676(unittest.TestCase):
def setUp(self): def setUp(self):
...@@ -32,4 +33,3 @@ class TestCwe676(unittest.TestCase): ...@@ -32,4 +33,3 @@ class TestCwe676(unittest.TestCase):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res assert res == expect_res
import unittest import unittest
import cwe_checker_testlib import cwe_checker_testlib
class TestCwe782(unittest.TestCase): class TestCwe782(unittest.TestCase):
def setUp(self): def setUp(self):
...@@ -11,4 +12,3 @@ class TestCwe782(unittest.TestCase): ...@@ -11,4 +12,3 @@ class TestCwe782(unittest.TestCase):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string)
assert res == expect_res assert res == expect_res
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment