summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorAndrew MacIntyre <andymac@bullseye.apana.org.au>2003-04-21 14:19:51 (GMT)
committerAndrew MacIntyre <andymac@bullseye.apana.org.au>2003-04-21 14:19:51 (GMT)
commit75e0145bb52af655643469df0c899618fbbcbe53 (patch)
tree8fe1e8fd533ad4b3592d689108aab870710b0aae /Modules/posixmodule.c
parent5549322c7993ddf17549249fd455775cd26f1385 (diff)
downloadcpython-75e0145bb52af655643469df0c899618fbbcbe53.zip
cpython-75e0145bb52af655643469df0c899618fbbcbe53.tar.gz
cpython-75e0145bb52af655643469df0c899618fbbcbe53.tar.bz2
- DosSetExtLIBPATH objects to a NULL pointer, but a pointer to a NULL
string does what is expected (ie unset [BEGIN|END]LIBPATH) - set the size of the DosQuerySysInfo buffer correctly; it was safe, but incorrect (allowing a 1 element overrun)
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index d34756a..879d57e 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -5410,9 +5410,6 @@ posix_putenv(PyObject *self, PyObject *args)
if (stricmp(s1, "BEGINLIBPATH") == 0) {
APIRET rc;
- if (strlen(s2) == 0) /* If New Value is an Empty String */
- s2 = NULL; /* Then OS/2 API Wants a NULL to Undefine It */
-
rc = DosSetExtLIBPATH(s2, BEGIN_LIBPATH);
if (rc != NO_ERROR)
return os2_error(rc);
@@ -5420,9 +5417,6 @@ posix_putenv(PyObject *self, PyObject *args)
} else if (stricmp(s1, "ENDLIBPATH") == 0) {
APIRET rc;
- if (strlen(s2) == 0) /* If New Value is an Empty String */
- s2 = NULL; /* Then OS/2 API Wants a NULL to Undefine It */
-
rc = DosSetExtLIBPATH(s2, END_LIBPATH);
if (rc != NO_ERROR)
return os2_error(rc);
@@ -7265,7 +7259,7 @@ static int insertvalues(PyObject *module)
char *ver, tmp[50];
Py_BEGIN_ALLOW_THREADS
- rc = DosQuerySysInfo(1, QSV_MAX, &values[1], sizeof(values));
+ rc = DosQuerySysInfo(1L, QSV_MAX, &values[1], sizeof(ULONG) * QSV_MAX);
Py_END_ALLOW_THREADS
if (rc != NO_ERROR) {