diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2017-10-07 22:59:35 +0300 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-07 22:59:35 +0300 | 
| commit | 79ba471488b936abda5ba5234b1ea90cbc94cae6 (patch) | |
| tree | bb050e9c72817d1acb54ddc4ae9fc186770aa196 /Objects | |
| parent | 28f713601d3ec80820e842dcb25a234093f1ff18 (diff) | |
| download | cpython-git-79ba471488b936abda5ba5234b1ea90cbc94cae6.tar.gz | |
bpo-31655: Validate keyword names in SimpleNamespace constructor. (#3909)
Diffstat (limited to 'Objects')
| -rw-r--r-- | Objects/namespaceobject.c | 6 | 
1 files changed, 5 insertions, 1 deletions
diff --git a/Objects/namespaceobject.c b/Objects/namespaceobject.c index 6deca961a4..e5698e6378 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);  }  | 
