File: issue8154.diff

package info (click to toggle)
python2.6 2.6.6-8%2Bdeb6u3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 65,368 kB
  • ctags: 106,965
  • sloc: ansic: 389,033; python: 375,783; asm: 9,734; sh: 4,934; makefile: 4,120; lisp: 2,933; objc: 775; xml: 62
file content (18 lines) | stat: -rw-r--r-- 666 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# DP: Issue #8154, fix segfault with os.execlp('true')

Index: python2.6-2.6.5+20100521/Modules/posixmodule.c
===================================================================
--- python2.6-2.6.5+20100521.orig/Modules/posixmodule.c	2010-05-21 16:11:09.200741779 +0200
+++ python2.6-2.6.5+20100521/Modules/posixmodule.c	2010-05-21 16:17:59.203713876 +0200
@@ -2979,6 +2979,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;
+    }
 
     argvlist = PyMem_NEW(char *, argc+1);
     if (argvlist == NULL) {