openbsd-ports/lang/python/2.4/patches/patch-Modules_posixmodule_c
alek 65a7f47309 Import python 2.4
Python is an interpreted, interactive, object-oriented
programming language that combines remarkable power with
very clear syntax.

tested by djm@ and mpech@ (but more tests are needed!)
mbalmer@ and xsa@ want it to go in
2005-06-07 01:12:54 +00:00

24 lines
758 B
Plaintext

$OpenBSD: patch-Modules_posixmodule_c,v 1.1.1.1 2005/06/07 01:12:58 alek Exp $
--- Modules/posixmodule.c.orig Fri Feb 18 17:13:36 2005
+++ Modules/posixmodule.c Fri Feb 18 17:14:28 2005
@@ -789,7 +789,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\
@@ -5350,6 +5349,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;