forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The `flag` and `mode` options were not being validated correctly. Signed-off-by: James M Snell <[email protected]> Fixes: nodejs#37430 PR-URL: nodejs#37480 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Rich Trott <[email protected]>
- Loading branch information
Showing
9 changed files
with
67 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
'use strict'; | ||
|
||
// Checks for crash regression: https://github.com/nodejs/node/issues/37430 | ||
|
||
const common = require('../common'); | ||
const assert = require('assert'); | ||
const { | ||
open, | ||
openSync, | ||
promises: { | ||
open: openPromise, | ||
}, | ||
} = require('fs'); | ||
|
||
// These should throw, not crash. | ||
|
||
assert.throws(() => open(__filename, 2176057344, common.mustNotCall()), { | ||
code: 'ERR_OUT_OF_RANGE' | ||
}); | ||
|
||
assert.throws(() => open(__filename, 0, 2176057344, common.mustNotCall()), { | ||
code: 'ERR_OUT_OF_RANGE' | ||
}); | ||
|
||
assert.throws(() => openSync(__filename, 2176057344), { | ||
code: 'ERR_OUT_OF_RANGE' | ||
}); | ||
|
||
assert.throws(() => openSync(__filename, 0, 2176057344), { | ||
code: 'ERR_OUT_OF_RANGE' | ||
}); | ||
|
||
assert.rejects(openPromise(__filename, 2176057344), { | ||
code: 'ERR_OUT_OF_RANGE' | ||
}); | ||
|
||
assert.rejects(openPromise(__filename, 0, 2176057344), { | ||
code: 'ERR_OUT_OF_RANGE' | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters