mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
src: fix buffer overflow for long exception lines
Long exception lines resulted in a stack buffer overflow or assertion because it was assumed snprintf not counts discarded chars or the assertion itself was incorrect: `(off) >= sizeof(arrow)` PR-URL: https://github.com/nodejs/node/pull/2404 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
1 parent
7038388558
commit
cddbec231f
3 files changed
+19
-12
No files matched your search
@@ -54,7 +54,11 @@ errExec('throws_error4.js', function(err, stdout, stderr) {
|
||||
assert.ok(/SyntaxError/.test(stderr));
|
||||
});
|
||||
|
||||
// Long exception line doesn't result in stack overflow
|
||||
errExec('throws_error5.js', function(err, stdout, stderr) {
|
||||
assert.ok(/SyntaxError/.test(stderr));
|
||||
});
|
||||
|
||||
process.on('exit', function() {
|
||||
assert.equal(4, exits);
|
||||
assert.equal(5, exits);
|
||||
});
|
||||
Reference in new issue
Block a user