[Python-checkins] r79096 - in python/trunk: Lib/test/test_os.py Misc/NEWS Modules/posixmodule.c

Ezio Melotti ezio.melotti at gmail.com
Mon Mar 22 17:53:08 CET 2010


On 19/03/2010 16.45, matthias.klose wrote:

> Author: matthias.klose
> Date: Fri Mar 19 15:45:06 2010
> New Revision: 79096
>
> Log:
> - Issue #1039, #8154: Fix os.execlp() crash with missing 2nd argument.
>
>
> Modified:
>     python/trunk/Lib/test/test_os.py
>     python/trunk/Misc/NEWS
>     python/trunk/Modules/posixmodule.c
>
> Modified: python/trunk/Lib/test/test_os.py
> ==============================================================================
> --- python/trunk/Lib/test/test_os.py	(original)
> +++ python/trunk/Lib/test/test_os.py	Fri Mar 19 15:45:06 2010
> @@ -505,6 +505,9 @@
>           except NotImplementedError:
>               pass
>
> +    def test_execvpe_with_bad_arglist(self):
> +        self.assertRaises(ValueError, os.execvpe, 'notepad', [], None)
> +
>   class Win32ErrorTests(unittest.TestCase):
>       def test_rename(self):
>           self.assertRaises(WindowsError, os.rename, test_support.TESTFN, test_support.TESTFN+".bak")
>
> Modified: python/trunk/Misc/NEWS
> ==============================================================================
> --- python/trunk/Misc/NEWS	(original)
> +++ python/trunk/Misc/NEWS	Fri Mar 19 15:45:06 2010
> @@ -63,6 +63,8 @@
>   Extension Modules
>   -----------------
>
> +- Issue #1039, #8154: Fix os.execlp() crash with missing 2nd argument.
> +
>   - Issue #6949: Allow the _bsddb extension to be built with db-4.8.x.
>
>   - Issue #8142: Update libffi to the 3.0.9 release.
>
> Modified: python/trunk/Modules/posixmodule.c
> ==============================================================================
> --- python/trunk/Modules/posixmodule.c	(original)
> +++ python/trunk/Modules/posixmodule.c	Fri Mar 19 15:45:06 2010
> @@ -2952,6 +2952,11 @@
>                   PyMem_Free(path);
>   		return NULL;
>   	}
> +	if (argc<  1) {
> +		PyErr_SetString(PyExc_ValueError, "execv() arg 2 must not be empty");
> +                PyMem_Free(path);
> +		return NULL;
> +	}
>
>    
Hi,
there are spaces mixed with tabs in this last part.

Regards,
Ezio Melotti

>   	argvlist = PyMem_NEW(char *, argc+1);
>   	if (argvlist == NULL) {
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins
>
>    



More information about the Python-checkins mailing list