Commit 066be5de by Thomas Barabosch

Fixed many issues due to pre-commit

parent 75c0712e
{ {
"CWE190": { "CWE190": {
"symbols": ["xmalloc", "malloc", "realloc"] "symbols": [
}, "xmalloc",
"CWE215": { "malloc",
"symbols": [] "realloc"
}, ]
"CWE243": { },
"pairs": [["chroot", "chdir"], ["chdir", "chroot", "setresuid"], ["chdir", "chroot", "seteuid"], "CWE215": {
["chdir", "chroot", "setreuid"], ["chdir", "chroot", "setuid"]], "symbols": []
"_comment": "valid chroot pathes according to http://www.unixwiz.net/techtips/chroot-practices.html" },
}, "CWE243": {
"CWE248": { "_comment": "valid chroot pathes according to http://www.unixwiz.net/techtips/chroot-practices.html",
"symbols": [] "pairs": [
}, [
"CWE332": { "chroot",
"pairs": [["srand", "rand"]] "chdir"
}, ],
"CWE367": { [
"pairs": [["access", "open"]] "chdir",
}, "chroot",
"CWE426": { "setresuid"
"symbols": ["setresgid", "setresuid", "setuid", "setgid", "seteuid", "setegid"], ],
"_comment": "functions that change/drop privileges" [
}, "chdir",
"CWE457": { "chroot",
"symbols": [] "seteuid"
}, ],
"CWE467": { [
"symbols": ["strncmp", "malloc", "chdir",
"alloca", "_alloca", "strncat", "wcsncat", "chroot",
"strncpy", "wcsncpy", "stpncpy", "wcpncpy", "setreuid"
"memcpy", "wmemcpy", "memmove", "wmemmove", "memcmp", "wmemcmp"], ],
"_comment": "any function that takes something of type size_t could be a possible candidate." [
}, "chdir",
"CWE476": { "chroot",
"symbols": ["malloc", "calloc", "realloc", "getenv", "bsearch", "setlocale", "tmpfile", "tmpnam", "setuid"
"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.", },
"_comment1": "included functions of the following libs: stdlib.h, locale.h, stdio.h, cstring.h, wchar.h" "CWE248": {
}, "symbols": []
"CWE676": { },
"_comment": "https://github.com/01org/safestringlib/wiki/SDL-List-of-Banned-Functions", "CWE332": {
"symbols": ["alloca", "_alloca", "pairs": [
"scanf", "wscanf", "sscanf", "swscanf", "vscanf", "vsscanf", [
"strlen", "wcslen", "strtok", "strtok_r", "wcstok", "srand",
"strcat", "strncat", "wcscat", "wcsncat", "rand"
"strcpy", "strncpy", "wcscpy", "wcsncpy", "stpcpy", "stpncpy", "wcpcpy", "wcpncpy", ]
"memcpy", "wmemcpy", "memmove", "wmemmove", "memcmp", "wmemcmp", "me​mset", "wmemset", ]
"gets", "sprintf​", "vsprintf", "swprintf", "vswprintf", "snprintf", "vsnprintf", },
"realpath", "getwd", "wctomb", "wcrtomb", "wcstombs", "wcsrtombs", "wcsnrtombs"] "CWE367": {
}, "pairs": [
"CWE782": { [
"symbols": [] "access",
} "open"
]
]
},
"CWE426": {
"_comment": "functions that change/drop privileges",
"symbols": [
"setresgid",
"setresuid",
"setuid",
"setgid",
"seteuid",
"setegid"
]
},
"CWE457": {
"symbols": []
},
"CWE467": {
"_comment": "any function that takes something of type size_t could be a possible candidate.",
"symbols": [
"strncmp",
"malloc",
"alloca",
"_alloca",
"strncat",
"wcsncat",
"strncpy",
"wcsncpy",
"stpncpy",
"wcpncpy",
"memcpy",
"wmemcpy",
"memmove",
"wmemmove",
"memcmp",
"wmemcmp"
]
},
"CWE476": {
"_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",
"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": {
"_comment": "https://github.com/01org/safestringlib/wiki/SDL-List-of-Banned-Functions",
"symbols": [
"alloca",
"_alloca",
"scanf",
"wscanf",
"sscanf",
"swscanf",
"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": {
"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):
...@@ -31,4 +32,4 @@ class TestCwe215(unittest.TestCase): ...@@ -31,4 +32,4 @@ class TestCwe215(unittest.TestCase):
def test_cwe215_01_mips(self): def test_cwe215_01_mips(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.filename, self.target, 'mips', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.filename, self.target, 'mips', self.string)
assert res == expect_res assert res == expect_res
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