Re: pgAdmin III: crash when trying to save edited pg_hba.conf

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: Nikhil S <nixmisc(at)gmail(dot)com>, pgadmin-hackers(at)postgresql(dot)org
Subject: Re: pgAdmin III: crash when trying to save edited pg_hba.conf
Date: 2011-01-29 08:45:22
Message-ID: AANLkTiku07K_TKrMpjLu6wUqne_mXTd3ZU4ZD=w6ddkB@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

On Fri, Jan 28, 2011 at 10:39 PM, Guillaume Lelarge
<guillaume(at)lelarge(dot)info> wrote:
> Le 28/01/2011 10:18, Nikhil S a écrit :
>> Hi,
>>
>> The following set of operations induce a crash in the latest git code base:
>>
>> 1. Open pgAdmin III
>> 2. Go to File Menu->Open Postgressql.conf
>> 3. From data folder select pg_hba.conf file and open it
>> 4. The file opens successfully
>> 5. Now select any setting ("port" for example) and add a Value and Comment
>> to it
>> 6. A save of this induces a crash
>>
>> The issue appears to be in the dlgMainConfig::dlgMainConfig() function. If
>> there is no old setting present, the item->newLine object uses the default
>> constructor. This does not set the item->newLine->item field at all.
>>
>> While eventually saving this via frmMainConfig::WriteFile() function, we end
>> up accessing the null "item" field causing this segmentation fault. The fix
>> is to set this field properly inside the dlgMainConfig call above. Is my
>> reasoning and the attached fix correct? Please let me know.
>>
>
> Seems good enough. Commited. Thanks a lot :)

Thanks Guillaume. I had put this on my TODO :-)

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Nikhil S 2011-01-29 08:56:30 pgAdmin III: Error on clicking "Display Objects" while doing a restore
Previous Message Nikhil S 2011-01-29 08:05:21 Re: pgAdmin III: crash when trying to save edited pg_hba.conf