Skip site navigation (1) Skip section navigation (2)

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

From: Nikhil S <nixmisc(at)gmail(dot)com>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: pgAdmin III: crash when trying to save edited pg_hba.conf
Date: 2011-01-28 09:18:42
Message-ID: AANLkTi=+JmDSa9hLais8fjwPjPpe2LR0oTtCT4C3Jx8e@mail.gmail.com (view raw or flat)
Thread:
Lists: pgadmin-hackers
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.

Regards,
Nikhils

Attachment: pgadmin_file_save_crash.patch
Description: text/x-diff (487 bytes)

Responses

pgadmin-hackers by date

Next:From: Guillaume LelargeDate: 2011-01-28 18:24:36
Subject: Re: Patch to support SSL certificate connections
Previous:From: Guillaume LelargeDate: 2011-01-28 08:37:47
Subject: Re: Patch to support SSL certificate connections

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group