mirror of https://github.com/lukechilds/node.git
Browse Source
Throw an exception when the path contains nul bytes, don't abort. Fixes: https://github.com/nodejs/node/issues/13787 PR-URL: https://github.com/nodejs/node/pull/14854 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>canary-base
committed by
Anna Henningsen
2 changed files with 12 additions and 0 deletions
@ -0,0 +1,9 @@ |
|||
'use strict'; |
|||
|
|||
require('../common'); |
|||
const assert = require('assert'); |
|||
|
|||
// Nul bytes should throw, not abort.
|
|||
assert.throws(() => require('\u0000ab'), /Cannot find module '\u0000ab'/); |
|||
assert.throws(() => require('a\u0000b'), /Cannot find module 'a\u0000b'/); |
|||
assert.throws(() => require('ab\u0000'), /Cannot find module 'ab\u0000'/); |
Loading…
Reference in new issue