mirror of
https://github.com/github/codeql.git
synced 2026-05-04 05:05:12 +02:00
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:
committed by
GitHub
parent
c4f27ed4cc
commit
3fb64abb09
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -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.
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user