Skip to content

Commit f304f91

Browse files
committed
os: freeze signals constant
Remove the ability to mutate signals constant as doing so can lead to unexpected behavior, notably when spawning child process. Fixes: #44749
1 parent 28b1139 commit f304f91

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/os.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const {
2727
ObjectDefineProperties,
2828
StringPrototypeSlice,
2929
SymbolToPrimitive,
30+
ObjectFreeze,
3031
} = primordials;
3132

3233
const { getTempDir } = internalBinding('credentials');
@@ -330,6 +331,8 @@ module.exports = {
330331
machine: getMachine,
331332
};
332333

334+
ObjectFreeze(constants.signals);
335+
333336
ObjectDefineProperties(module.exports, {
334337
constants: {
335338
__proto__: null,

0 commit comments

Comments
 (0)