diff options
| author | Arch Librarian <arch@canonical.com> | 2004-11-24 10:00:34 +0000 |
|---|---|---|
| committer | Arch Librarian <arch@canonical.com> | 2004-11-24 10:00:34 +0000 |
| commit | 45c7f51d93969f32796be6db20cd947f2897a206 (patch) | |
| tree | 2733e8c58a9567f4572cac3934a882c8b1cdf816 /python | |
| parent | a658a076e1329d52467a4aca3a247cb2debd0b45 (diff) | |
| download | python-apt-45c7f51d93969f32796be6db20cd947f2897a206.tar.gz | |
Avoid null pointer deref in CnfKeys()
Author: mdz
Date: 2003-06-03 03:22:27 GMT
Avoid null pointer deref in CnfKeys()
Diffstat (limited to 'python')
| -rw-r--r-- | python/configuration.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/python/configuration.cc b/python/configuration.cc index a15c4694..6cf33581 100644 --- a/python/configuration.cc +++ b/python/configuration.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: configuration.cc,v 1.3 2002/02/26 01:36:15 mdz Exp $ +// $Id: configuration.cc,v 1.4 2003/06/03 03:22:27 mdz Exp $ /* ###################################################################### Configuration - Binding for the configuration object. @@ -235,9 +235,11 @@ static PyObject *CnfKeys(PyObject *Self,PyObject *Args) PyObject *List = PyList_New(0); const Configuration::Item *Top = GetSelf(Self).Tree(RootName); const Configuration::Item *Stop = Top; + const Configuration::Item *Root = 0; if (RootName == 0) Stop = 0; - const Configuration::Item *Root = GetSelf(Self).Tree(0)->Parent; + if (Top != 0) + Root = GetSelf(Self).Tree(0)->Parent; for (; Top != 0;) { PyObject *Obj; |
