Re: BUG: pgIndex.cpp

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "P3 Consulting" <p3c(at)p3-consulting(dot)net>, "pgadmin-hackers" <pgadmin-hackers(at)postgresql(dot)org>
Cc: "Andreas Pflug" <pgadmin(at)pse-consulting(dot)de>
Subject: Re: BUG: pgIndex.cpp
Date: 2005-01-12 09:12:40
Message-ID: E7F85A1B5FF8D44C8A1AF6885BC9A0E452835B@ratbert.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

> -----Original Message-----
> From: pgadmin-hackers-owner(at)postgresql(dot)org
> [mailto:pgadmin-hackers-owner(at)postgresql(dot)org] On Behalf Of P3
> Consulting
> Sent: 08 January 2005 10:28
> To: pgadmin-hackers
> Subject: [pgadmin-hackers] BUG: pgIndex.cpp
>
> switch (indexes->GetVal(wxT("contype"))[0U])
> {
> case 0:
> index = new pgIndex(collection->GetSchema(),
indexes->GetVal(wxT("idxname")));
> break;
> case 'p':
> index = new pgPrimaryKey(collection->GetSchema(),
indexes->GetVal(wxT("idxname")));
> break;
> case 'u':
> index = new pgUnique(collection->GetSchema(),
indexes->GetVal(wxT("idxname")));
> break;
> default:
> index=0;
> break;
> }
> index->iSetOid(indexes->GetOid(wxT("oid")));
>
> in case of the default branch taken, this code will SIGSEGV

Hi Andreas,

Did you get a chance to look at this? It seems to me that the quick and
dirty solution is to wrap the index->iSetxxx calls in an 'if (index)',
however I'm not entirely convinced that is safe given that it's possible
to return a null index pointer to the caller (which without significant
trawling through code I may not find all instances of).

Regards, Dave.

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Andreas Pflug 2005-01-12 09:27:16 Re: BUG: pgIndex.cpp
Previous Message Andreas Pflug 2005-01-11 22:30:29 Re: I fixed a couple compile errors, but not all,