From 0334598b5091db2a4142d4bede05833cb90a38ff Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Sun, 8 Mar 2009 16:42:36 -0700 Subject: [PATCH] Fix io.BytesIO to not accept arbitrary keywords --- Modules/_bytesio.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git Modules/_bytesio.c Modules/_bytesio.c index 0068cb7..f9aec2d 100644 --- Modules/_bytesio.c +++ Modules/_bytesio.c @@ -642,9 +642,11 @@ bytesio_new(PyTypeObject *type, PyObject *args, PyObject *kwds) static int bytesio_init(BytesIOObject *self, PyObject *args, PyObject *kwds) { + char *kwlist[] = {"initial_bytes", NULL}; PyObject *initvalue = NULL; - if (!PyArg_ParseTuple(args, "|O:BytesIO", &initvalue)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:BytesIO", kwlist, + &initvalue)) return -1; /* In case, __init__ is called multiple times. */ -- 1.6.1.3