mirror of
https://github.com/github/codeql.git
synced 2026-04-20 06:24:03 +02:00
add test of a length check
This commit is contained in:
@@ -84,4 +84,11 @@ var server = http.createServer(function(req, res) {
|
||||
setInterval(f, s); // NOT OK
|
||||
|
||||
Buffer.alloc(n.length); // OK - only allocing as much as the length of the input.
|
||||
|
||||
Buffer.alloc(n); // NOT OK
|
||||
if (n < 1000) {
|
||||
Buffer.alloc(n); // OK - length check
|
||||
} else {
|
||||
Buffer.alloc(n); // NOT OK - NO length check
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user