[issue10308] Modules/getpath.c bugs

STINNER Victor report at bugs.python.org
Wed Nov 10 15:29:28 CET 2010


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

r86399 fixes the code checking PyUnicode_AsWideChar() failure.

The following change is useless, it cannot overflow:

-    if (n + k > MAXPATHLEN)
+    if (k > MAXPATHLEN - n)
         k = MAXPATHLEN - n;

n and k maximum values are MAXPATHLEN (and the maximum value of MAXPATHLEN is 4096), whereas n and k type maximum values are at least 2^31.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10308>
_______________________________________


More information about the Python-bugs-list mailing list