crash in LIBPQ_execute_query - Mailing list pgsql-odbc

From Scot Loach
Subject crash in LIBPQ_execute_query
Date
Msg-id 71837C040963F748B9B94E123A289678664DFD@mailserver.sandvine.com
Whole thread Raw
List pgsql-odbc
Some of the queries we use can be very large.
My code is crashing here:

QResultClass *
LIBPQ_execute_query(ConnectionClass *self,char *query)                          {
        QResultClass *qres;                                                             PGresult *pgres;
        char            *ptr;
        char            cmdbuffer[ERROR_MSG_LENGTH + 1];
    char                errbuffer[ERROR_MSG_LENGTH + 1];                            int         pos=0;

        strcpy(cmdbuffer,query);


ERROR_MSG_LENGTH is 4096, my query is larger than that.
What's the rationale here and how do we fix it?  This works fine with the old driver.

pgsql-odbc by date:

Previous
From: "Anoop Kumar"
Date:
Subject: Re: Unicode support
Next
From: "Merlin Moncure"
Date:
Subject: Re: crash in LIBPQ_execute_query