diff options
| author | Julian Andres Klode <jak@debian.org> | 2011-04-11 10:13:15 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2011-04-11 10:13:15 +0200 |
| commit | d5e763e1920eadf0bc0d460abbf686c65db2a3b4 (patch) | |
| tree | f0f38674b4281ac5502366b4a41563d1407085ee /python | |
| parent | fedfc6ec4584f43364e13e35326d051f5526700b (diff) | |
| download | python-apt-d5e763e1920eadf0bc0d460abbf686c65db2a3b4.tar.gz | |
apt_pkg: Raise error when parse_commandline gets empty argv (LP: #707416)
Diffstat (limited to 'python')
| -rw-r--r-- | python/configuration.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/python/configuration.cc b/python/configuration.cc index 93e92efa..b6a44b44 100644 --- a/python/configuration.cc +++ b/python/configuration.cc @@ -438,6 +438,10 @@ PyObject *ParseCommandLine(PyObject *Self,PyObject *Args) return 0; } + if (PySequence_Length(Pargv) < 1) { + PyErr_SetString(PyExc_ValueError,"argv is an empty sequence"); + return 0; + } // Convert the option list int Length = PySequence_Length(POList); CommandLine::Args *OList = new CommandLine::Args[Length+1]; |
