summaryrefslogtreecommitdiff
path: root/Modules/clinic/_lzmamodule.c.h
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2017-02-04 15:05:50 -0800
committerSteve Dower <steve.dower@microsoft.com>2017-02-04 15:05:50 -0800
commit3b0e4320092ac0504b6670cafaf0301b908c91fc (patch)
treed3be1b6b844d61763bb366fa21ceed475e5703fd /Modules/clinic/_lzmamodule.c.h
parentb2fa705fd3887c326e811c418469c784353027f4 (diff)
parentf687fbcd73c14dfcbe086eb5cd94b298f1e81e72 (diff)
downloadcpython-3b0e4320092ac0504b6670cafaf0301b908c91fc.tar.gz
Issue #29392: Prevent crash when passing invalid arguments into msvcrt module.
Diffstat (limited to 'Modules/clinic/_lzmamodule.c.h')
-rw-r--r--Modules/clinic/_lzmamodule.c.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/Modules/clinic/_lzmamodule.c.h b/Modules/clinic/_lzmamodule.c.h
index 9e6075954a..a3b1ad5c6c 100644
--- a/Modules/clinic/_lzmamodule.c.h
+++ b/Modules/clinic/_lzmamodule.c.h
@@ -96,7 +96,7 @@ _lzma_LZMADecompressor_decompress(Decompressor *self, PyObject **args, Py_ssize_
Py_buffer data = {NULL, NULL};
Py_ssize_t max_length = -1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&data, &max_length)) {
goto exit;
}
@@ -229,23 +229,27 @@ PyDoc_STRVAR(_lzma__decode_filter_properties__doc__,
"The result does not include the filter ID itself, only the options.");
#define _LZMA__DECODE_FILTER_PROPERTIES_METHODDEF \
- {"_decode_filter_properties", (PyCFunction)_lzma__decode_filter_properties, METH_VARARGS, _lzma__decode_filter_properties__doc__},
+ {"_decode_filter_properties", (PyCFunction)_lzma__decode_filter_properties, METH_FASTCALL, _lzma__decode_filter_properties__doc__},
static PyObject *
_lzma__decode_filter_properties_impl(PyObject *module, lzma_vli filter_id,
Py_buffer *encoded_props);
static PyObject *
-_lzma__decode_filter_properties(PyObject *module, PyObject *args)
+_lzma__decode_filter_properties(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
lzma_vli filter_id;
Py_buffer encoded_props = {NULL, NULL};
- if (!PyArg_ParseTuple(args, "O&y*:_decode_filter_properties",
+ if (!_PyArg_ParseStack(args, nargs, "O&y*:_decode_filter_properties",
lzma_vli_converter, &filter_id, &encoded_props)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("_decode_filter_properties", kwnames)) {
+ goto exit;
+ }
return_value = _lzma__decode_filter_properties_impl(module, filter_id, &encoded_props);
exit:
@@ -256,4 +260,4 @@ exit:
return return_value;
}
-/*[clinic end generated code: output=f27abae460122706 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5f7a915fb7e41453 input=a9049054013a1b77]*/