aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-error-reporting.js
diff options
context:
space:
mode:
authorKarl Skomski <karl@skomski.com>2015-09-03 10:10:29 +0200
committerRod Vagg <rod@vagg.org>2015-09-06 21:38:07 +1000
commit3bb923740d10b5c2272243a39ebcf4a7093e3c6f (patch)
tree623e783fb96599fe05c04b2122a475dbd6b15807 /test/parallel/test-error-reporting.js
parentf0a75ab2d310e858bf3090c82667d60be9c7d401 (diff)
downloadandroid-node-v8-3bb923740d10b5c2272243a39ebcf4a7093e3c6f.tar.gz
android-node-v8-3bb923740d10b5c2272243a39ebcf4a7093e3c6f.tar.bz2
android-node-v8-3bb923740d10b5c2272243a39ebcf4a7093e3c6f.zip
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>
Diffstat (limited to 'test/parallel/test-error-reporting.js')
-rw-r--r--test/parallel/test-error-reporting.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/parallel/test-error-reporting.js b/test/parallel/test-error-reporting.js
index 0b5c765287..cea60cf90f 100644
--- a/test/parallel/test-error-reporting.js
+++ b/test/parallel/test-error-reporting.js
@@ -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);
});