Skip to content

Commit 542744b

Browse files
RaisinTenjuanarbol
authored andcommitted
src,inspector: fix empty MaybeLocal crash
Return early when the Inspector StringView to V8 String conversion fails and returns an empty MaybeLocal instead of running the invalid ToLocalChecked() assertion. Fixes: #42407 Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: #42409 Backport--PR-URL: #42967 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 55bbdd7 commit 542744b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
'use strict';
2+
const common = require('../common');
3+
4+
if (process.config.variables.arm_version === '7') {
5+
common.skip('Too slow for armv7 bots');
6+
}
7+
8+
// The process should not crash when the REPL receives the string, 'ss'.
9+
// Test for https://github.com/nodejs/node/issues/42407.
10+
11+
const repl = require('repl');
12+
13+
const r = repl.start();
14+
15+
r.write('var buf = Buffer.from({length:200e6},(_,i) => i%256);\n');
16+
r.write('var ss = buf.toString("binary");\n');
17+
r.write('ss');
18+
r.write('.');
19+
20+
r.close();

0 commit comments

Comments
 (0)