$OpenBSD: patch-Modules_posixmodule_c,v 1.2 2006/11/01 20:38:37 alek Exp $ --- Modules/posixmodule.c.orig Mon Oct 9 21:29:06 2006 +++ Modules/posixmodule.c Sat Oct 21 15:06:38 2006 @@ -805,7 +805,7 @@ statresult_new(PyTypeObject *type, PyObj /* If true, st_?time is float. */ -static int _stat_float_times = 0; +static int _stat_float_times = 1; PyDoc_STRVAR(stat_float_times__doc__, "stat_float_times([newval]) -> oldval\n\n\ @@ -5417,6 +5417,10 @@ posix_read(PyObject *self, PyObject *arg PyObject *buffer; if (!PyArg_ParseTuple(args, "ii:read", &fd, &size)) return NULL; + if (size < 0) { + errno = EINVAL; + return posix_error(); + } buffer = PyString_FromStringAndSize((char *)NULL, size); if (buffer == NULL) return NULL;