Re: [pgAdmin4][Patch] RM #3277 Runtime startup error handling is broken on Windows

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgAdmin4][Patch] RM #3277 Runtime startup error handling is broken on Windows
Date: 2018-05-31 14:07:34
Message-ID: CA+OCxozs18ZfdbgeShMd-anak9124Ap68rib=tV=5CRObCwwVw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Thanks, applied.

On Thu, May 31, 2018 at 4:52 AM, Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com
> wrote:

> Hi Hackers,
>
> Attached is the patch file to fix RM #3277 Runtime startup error handling
> is broken on Windows. I have figure out the crash at the following call of
> Server.cpp(line no 326):
>
> PyRun_SimpleFile(fdopen(PyObject_AsFileDescriptor(PyFileObject),"r"), m_
> appfile_utf8.data())
>
> When application exits due to some error it throws *BEX refers to Buffer
> Overflow Exception, *when I debug and found that it throws BEX for above
> function call. I have replace that call with the following:
>
> PyRun_SimpleFile(cp, m_appfile_utf8.data())
>
> Anyways we have open the file using fopen() at the top of the function
> then why to open that again using *fdopen() **in the first call. *
>
> Tested the patch with Python 3.5 and 3.6, please review it.
>
> --
> *Akshay Joshi*
>
> *Sr. Software Architect *
>
>
>
> *Phone: +91 20-3058-9517Mobile: +91 976-788-8246*
>

--
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 Dave Page 2018-05-31 14:10:48 pgAdmin 4 commit: Fix an issue where a change to any field in server di
Previous Message Dave Page 2018-05-31 14:07:12 pgAdmin 4 commit: Cleanup Python 3 server startup code. Fixes #3277