summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRishab Joshi <rishab.joshi@mongodb.com>2021-07-23 13:26:18 +0000
committerRishab Joshi <rishab.joshi@mongodb.com>2021-08-20 17:01:06 +0000
commit2e8cc64d061a0cd8ed0f98db92dd9232521f94ca (patch)
treea08b8078bb7e66bebcaddc8096b67aaf7de55148 /src
parentf2233a69550028c0a3dc4b15e040026cdba8bf1e (diff)
downloadmongo-2e8cc64d061a0cd8ed0f98db92dd9232521f94ca.tar.gz
SERVER-58420 Clamp safely the input value of changeUmask.
Diffstat (limited to 'src')
-rw-r--r--src/mongo/shell/shell_utils_extended.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/shell/shell_utils_extended.cpp b/src/mongo/shell/shell_utils_extended.cpp
index 550125c33ac..fbdddc1318d 100644
--- a/src/mongo/shell/shell_utils_extended.cpp
+++ b/src/mongo/shell/shell_utils_extended.cpp
@@ -422,7 +422,7 @@ BSONObj changeUmask(const BSONObj& a, void* data) {
uassert(50976,
"umask takes 1 argument, the octal mode of the umask",
a.nFields() == 1 && isNumericBSONType(a.firstElementType()));
- auto val = a.firstElement().Number();
+ auto val = a.firstElement().safeNumberInt();
return BSON("" << static_cast<int>(umask(static_cast<mode_t>(val))));
#endif
}