From 45c7f51d93969f32796be6db20cd947f2897a206 Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Wed, 24 Nov 2004 10:00:34 +0000 Subject: Avoid null pointer deref in CnfKeys() Author: mdz Date: 2003-06-03 03:22:27 GMT Avoid null pointer deref in CnfKeys() --- python/configuration.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'python/configuration.cc') 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; -- cgit v1.2.3