fix consistency and spelling in the documentation

suggestions from the documentation team

Co-Authored-By: shati-patel <42641846+shati-patel@users.noreply.github.com>
This commit is contained in:
Erik Krogh Kristensen
2019-09-13 14:52:11 +01:00
committed by GitHub
parent c4f27ed4cc
commit 3fb64abb09
10 changed files with 24 additions and 24 deletions

View File

@@ -42,7 +42,7 @@ function useLengthIndirectly(val) {
}
}
// the obvious null-pointer detection should not hit this one.
// The obvious null-pointer detection should not hit this one.
function noNullPointer(val) {
var ret = [];
@@ -50,7 +50,7 @@ function noNullPointer(val) {
for (var i = 0; i < val.length; i++) { // NOT OK!
// constantly accessing element 0, therefore not guaranteed null-pointer.
// Constantly accessing element 0, therefore not guaranteed null-pointer.
ret.push(val[c].foo);
}
}
}

View File

@@ -36,7 +36,7 @@ function throws(val) {
try {
throw 2; // Is caught, and therefore the DoS is not prevented.
} catch(e) {
// ignored
// Ignored.
}
}
ret.push(val[i]);
@@ -60,9 +60,9 @@ function lodashThrow(val) { // NOT OK!
_.map(val, function (e) {
if (!e) {
try {
throw new Error(); // Does not prevent DoS
throw new Error(); // Does not prevent DoS.
} catch(e) {
// ignored.
// Ignored.
}
}
})

View File

@@ -19,7 +19,7 @@ function breaks(val) {
for (var i = 0; i < val.length; i++) { // OK
if (val[i] == null) {
break; // prevents DoS.
break; // Prevents DoS.
}
ret.push(val[i]);
}
@@ -30,7 +30,7 @@ function throws(val) {
for (var i = 0; i < val.length; i++) { // OK
if (val[i] == null) {
throw 2; // prevents DoS.
throw 2; // Prevents DoS.
}
ret.push(val[i]);
}
@@ -42,7 +42,7 @@ function returns(val) {
for (var i = 0; i < val.length; i++) { // OK
if (val[i] == null) {
return 2; // prevents DoS.
return 2; // Prevents DoS.
}
ret.push(val[i]);
}
@@ -51,7 +51,7 @@ function returns(val) {
function lodashThrow(val) {
_.map(val, function (e) { // OK
if (!e) {
throw new Error(); // prevents DoS.
throw new Error(); // Prevents DoS.
}
})
}

View File

@@ -20,7 +20,7 @@ function sanitized(val) {
if (!Array.isArray(val)) {
return [];
}
// At this point we know that val must be an Array, and an attacked is
// At this point we know that val must be an Array, and an attacker is
// therefore not able to send a cheap request that spends a lot of time
// inside the loop.
for (var i = 0; i < val.length; i++) { // OK
@@ -50,7 +50,7 @@ function sanitized3(val) {
if (!isArray(val)) {
return [];
}
// At this point we know that val must be an Array, and an attacked is
// At this point we know that val must be an Array, and an attacker is
// therefore not able to send a cheap request that spends a lot of time
// inside the loop.
for (var i = 0; i < val.length; i++) { // OK
@@ -64,7 +64,7 @@ function sanitized4(val) {
if (!(val instanceof Array)) {
return [];
}
// At this point we know that val must be an Array, and an attacked is
// At this point we know that val must be an Array, and an attacker is
// therefore not able to send a cheap request that spends a lot of time
// inside the loop.
for (var i = 0; i < val.length; i++) { // OK