cpython: 44c8a9d80595 (original) (raw)

Mercurial > cpython

changeset 84298:44c8a9d80595

Issue #11016: Detect integer conversion on conversion from Python int to C mode_t [#11016]

Victor Stinner victor.stinner@gmail.com
date Sun, 23 Jun 2013 22:57:43 +0200
parents 153f7c0df033
children e290451883d0 cb70776241bb
files Modules/_stat.c
diffstat 1 files changed, 27 insertions(+), 13 deletions(-)[+] [-] Modules/_stat.c 40

line wrap: on

line diff

--- a/Modules/_stat.c +++ b/Modules/_stat.c @@ -258,15 +258,32 @@ typedef unsigned short mode_t;

define SF_SNAPSHOT 0x00200000

#endif +static mode_t +_PyLong_AsMode_t(PyObject *op) +{

+

+

+} + #define stat_S_ISFUNC(isfunc, doc) [](#l1.26) static PyObject * [](#l1.27) stat_ ##isfunc (PyObject *self, PyObject *omode) [](#l1.28) { [](#l1.29)

@@ -332,10 +348,9 @@ PyDoc_STRVAR(stat_S_IFMT_doc, static PyObject * stat_S_IFMT(PyObject *self, PyObject *omode) {

@@ -395,12 +410,11 @@ static PyObject * stat_filemode(PyObject *self, PyObject *omode) { char buf[10];

buf[0] = filetype(mode); fileperm(mode, &buf[1]);