move comments to match alert location for CWE-834

This commit is contained in:
Erik Krogh Kristensen
2020-07-08 10:16:04 +02:00
parent 71a3d49d2b
commit 45b6906a0d
2 changed files with 4 additions and 4 deletions

View File

@@ -35,9 +35,9 @@ function whileLoop(val) {
function useLengthIndirectly(val) {
var ret = [];
var len = val.length;
var len = val.length; // NOT OK!
for (var i = 0; i < len; i++) { // NOT OK!
for (var i = 0; i < len; i++) {
ret.push(val[i]);
}
}

View File

@@ -56,8 +56,8 @@ function returns(val) {
}
}
function lodashThrow(val) { // NOT OK!
_.map(val, function (e) {
function lodashThrow(val) {
_.map(val, function (e) { // NOT OK!
if (!e) {
try {
throw new Error(); // Does not prevent DoS.