Commit 066be5de by Thomas Barabosch

Fixed many issues due to pre-commit

parent 75c0712e
{
"CWE190": {
"symbols": ["xmalloc", "malloc", "realloc"]
"symbols": [
"xmalloc",
"malloc",
"realloc"
]
},
"CWE215": {
"symbols": []
},
"CWE243": {
"pairs": [["chroot", "chdir"], ["chdir", "chroot", "setresuid"], ["chdir", "chroot", "seteuid"],
["chdir", "chroot", "setreuid"], ["chdir", "chroot", "setuid"]],
"_comment": "valid chroot pathes according to http://www.unixwiz.net/techtips/chroot-practices.html"
"_comment": "valid chroot pathes according to http://www.unixwiz.net/techtips/chroot-practices.html",
"pairs": [
[
"chroot",
"chdir"
],
[
"chdir",
"chroot",
"setresuid"
],
[
"chdir",
"chroot",
"seteuid"
],
[
"chdir",
"chroot",
"setreuid"
],
[
"chdir",
"chroot",
"setuid"
]
]
},
"CWE248": {
"symbols": []
},
"CWE332": {
"pairs": [["srand", "rand"]]
"pairs": [
[
"srand",
"rand"
]
]
},
"CWE367": {
"pairs": [["access", "open"]]
"pairs": [
[
"access",
"open"
]
]
},
"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": {
"symbols": []
},
"CWE467": {
"symbols": ["strncmp", "malloc",
"alloca", "_alloca", "strncat", "wcsncat",
"strncpy", "wcsncpy", "stpncpy", "wcpncpy",
"memcpy", "wmemcpy", "memmove", "wmemmove", "memcmp", "wmemcmp"],
"_comment": "any function that takes something of type size_t could be a possible candidate."
"_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": {
"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.",
"_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": {
"_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​mset", "wmemset",
"gets", "sprintf​", "vsprintf", "swprintf", "vswprintf", "snprintf", "vsnprintf",
"realpath", "getwd", "wctomb", "wcrtomb", "wcstombs", "wcsrtombs", "wcsnrtombs"]
"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 cwe_checker_testlib
class TestCwe190(unittest.TestCase):
def setUp(self):
......@@ -32,4 +33,3 @@ class TestCwe190(unittest.TestCase):
expect_res = 3
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res
import unittest
import cwe_checker_testlib
class TestCwe215(unittest.TestCase):
def setUp(self):
......
import unittest
import cwe_checker_testlib
class TestCwe243(unittest.TestCase):
def setUp(self):
......
import unittest
import cwe_checker_testlib
class TestCwe248(unittest.TestCase):
def setUp(self):
......@@ -33,4 +34,3 @@ class TestCwe248(unittest.TestCase):
expect_res = 2
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res
import unittest
import cwe_checker_testlib
class TestCwe332(unittest.TestCase):
def setUp(self):
......@@ -32,4 +33,3 @@ class TestCwe332(unittest.TestCase):
expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res
import unittest
import cwe_checker_testlib
class TestCwe367(unittest.TestCase):
def setUp(self):
......@@ -32,4 +33,3 @@ class TestCwe367(unittest.TestCase):
expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res
import unittest
import cwe_checker_testlib
class TestCwe426(unittest.TestCase):
def setUp(self):
......@@ -33,4 +34,3 @@ class TestCwe426(unittest.TestCase):
expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res
import unittest
import cwe_checker_testlib
class TestCwe457(unittest.TestCase):
def setUp(self):
......@@ -36,4 +37,3 @@ class TestCwe457(unittest.TestCase):
expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res
import unittest
import cwe_checker_testlib
class TestCwe467(unittest.TestCase):
def setUp(self):
......@@ -33,4 +34,3 @@ class TestCwe467(unittest.TestCase):
expect_res = 2
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res
import unittest
import cwe_checker_testlib
class TestCwe476(unittest.TestCase):
def setUp(self):
......@@ -33,4 +34,3 @@ class TestCwe476(unittest.TestCase):
expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res
import unittest
import cwe_checker_testlib
class TestCwe676(unittest.TestCase):
def setUp(self):
......@@ -32,4 +33,3 @@ class TestCwe676(unittest.TestCase):
expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res
import unittest
import cwe_checker_testlib
class TestCwe782(unittest.TestCase):
def setUp(self):
......@@ -11,4 +12,3 @@ class TestCwe782(unittest.TestCase):
expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string)
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