From c351bda3dac885b0c92d2af73b863b24de6f0078 Mon Sep 17 00:00:00 2001 From: hayoung13 <44959615+hayoung13@users.noreply.github.com> Date: Mon, 21 Jan 2019 15:10:29 +0900 Subject: [PATCH 1/2] test01211510 test01211510 --- cwe.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cwe.js b/cwe.js index bb09a12..64ce716 100644 --- a/cwe.js +++ b/cwe.js @@ -2,7 +2,7 @@ function CWE_398() { // IDENTICAL_BRANCHES if (x >= 0) { - y = x; + y = a; } else { y = x; } From 67f3d5f990aa8a7f5ff45dfc8e3f0f1eee7db89e Mon Sep 17 00:00:00 2001 From: deepscan Date: Mon, 21 Jan 2019 15:15:10 +0900 Subject: [PATCH 2/2] Delete cwe.js --- cwe.js | 67 ---------------------------------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 cwe.js diff --git a/cwe.js b/cwe.js deleted file mode 100644 index 64ce716..0000000 --- a/cwe.js +++ /dev/null @@ -1,67 +0,0 @@ -// This will show examples related with the Common Weakness Enumeration (CWE). - - function CWE_398() { // IDENTICAL_BRANCHES - if (x >= 0) { - y = a; - } else { - y = x; - } - } - - function CWE_476() { // NULL_POINTER - var obj; - var y = obj.x; - console.log(y); - } - - function CWE_480() { // BAD_BITWISE_OPERATOR - var obj = null; - if (obj & obj.prop) { - console.log(obj.prop); - } - } - - function CWE_480_481() { // BAD_ASSIGN_IN_CONDITION - var x = -1; - if (x = -1) console.log('Error!', x); - } - - function CWE_482_665() { // UNUSED_EXPR - this.foo; - } - - function CWE_484() { // SWITCH_CASE_FALL_THROUGH - var x; - switch (x) { - case '1': console.log('Do one thing'); - case '2': console.log('Do another thing'); - } - } - - function CWE_561() { // UNREACHABLE_CODE - return; - - var bar = 1; - console.log(bar); - } - - function CWE_563(url) { // UNUSED_VAR_ASSIGN - var foo = url + "?query=deepscan"; - foo = url.replace(/\s/gi, ""); - console.log(foo); - } - - function CWE_628() { // TOO_MANY_ARGS - function add(x, y) { - return x + y; - } - var sum = add(1, 2, 3); - console.log(sum); - } - - function CWE_670(x) { // STRAY_SEMICOLON - while (++x <= 10) ; - { - sum += x; - } - }