src: fix buffer overflow for long exception lines
authorKarl Skomski <karl@skomski.com>
Thu, 3 Sep 2015 08:10:29 +0000 (10:10 +0200)
committerRod Vagg <rod@vagg.org>
Sun, 6 Sep 2015 11:39:07 +0000 (21:39 +1000)
commitcddbec231f86774bbbb78fb271894a8fcf4e8dc1
tree7713a9b7867226d0810b3750a20c06b2f5eb4204
parent7038388558aa495283d27c769c0099b7ebf4845e
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>
src/node.cc
test/fixtures/throws_error5.js [new file with mode: 0644]
test/parallel/test-error-reporting.js