summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-10-07 19:59:35 (GMT)
committerGitHub <noreply@github.com>2017-10-07 19:59:35 (GMT)
commit79ba471488b936abda5ba5234b1ea90cbc94cae6 (patch)
treebb050e9c72817d1acb54ddc4ae9fc186770aa196 /Objects
parent28f713601d3ec80820e842dcb25a234093f1ff18 (diff)
downloadcpython-79ba471488b936abda5ba5234b1ea90cbc94cae6.zip
cpython-79ba471488b936abda5ba5234b1ea90cbc94cae6.tar.gz
cpython-79ba471488b936abda5ba5234b1ea90cbc94cae6.tar.bz2
bpo-31655: Validate keyword names in SimpleNamespace constructor. (#3909)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/namespaceobject.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Objects/namespaceobject.c b/Objects/namespaceobject.c
index 6deca96..e5698e6 100644
--- a/Objects/namespaceobject.c
+++ b/Objects/namespaceobject.c
@@ -44,8 +44,12 @@ namespace_init(_PyNamespaceObject *ns, PyObject *args, PyObject *kwds)
PyErr_Format(PyExc_TypeError, "no positional arguments expected");
return -1;
}
- if (kwds == NULL)
+ if (kwds == NULL) {
return 0;
+ }
+ if (!PyArg_ValidateKeywordArguments(kwds)) {
+ return -1;
+ }
return PyDict_Update(ns->ns_dict, kwds);
}