pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
To: martial.guex@mutech.ch
Cc: pgsql-odbc@postgresql.org
Subject: Re: Patch to solve memory protect violation and clear __error_number after call CC_lookup_characterset
Date: Tue, 24 Mar 2020 17:19:03 +0900
Message-ID: <152bdf12-5700-e640-3c75-eea299631129@dream.email.ne.jp> (raw)
In-Reply-To: <f34835d637ff57e34084096df114ad49@mutech.ch>
References: <f34835d637ff57e34084096df114ad49@mutech.ch>

Hello Martial,

The bugs were fixed in version 9.06.0500.
Please try the latest version(12.01.0000).

regards,
Hiroshi Inoue

On 2020/03/22 22:43, martial.guex@mutech.ch wrote:
> Hello,
>
> I have detected fatal memory error protection on call strdup 
> connectio.c(1045) and wrong setting conn.__error_number on 
> CC_lookup_lo when "select oid, typbasetype from pg_type where typname 
> = 'lo'" doesn't return any record.
>
> I used this patch to solve the problem on debian stretch with 
> odbc-postgresql:amd64 version 1:09.05.0400-2.
>
> --- psqlodbc-09.05.0400.orig/connection.c
> +++ psqlodbc-09.05.0400/connection.c
> @@ -1041,12 +1041,13 @@ CC_connect(ConnectionClass *self, char *
>   if (retsend)
>       retsend = CC_send_settings(self, 
> GET_NAME(self->connInfo.conn_settings));
>
> -    if (CC_get_errornumber(self) > 0)
> +    if ((CC_get_errornumber(self) > 0) && (CC_get_errormsg(self) != 
> NULL))
>          saverr = strdup(CC_get_errormsg(self));
>      CC_clear_error(self);            /* clear any error */
>      CC_lookup_lo(self);            /* a hack to get the oid of
>                             our large object oid type */
>
> +    CC_clear_error(self);            /* clear any error */
>      /* Multibyte handling */
>      CC_lookup_characterset(self);
>      if (CC_get_errornumber(self) > 0)
>
> It's probably better to clear self.__error_number directly on 
> CC_lookup_lo and when error_number is equal 110.
>
> Thank's for the job.





view thread (2+ messages)

Message-ID: <152bdf12-5700-e640-3c75-eea299631129@dream.email.ne.jp>
Permalink:  ../152bdf12-5700-e640-3c75-eea299631129@dream.email.ne.jp/
Also on:    postgresql.org/message-id/152bdf12-5700-e640-3c75-eea299631129@dream.email.ne.jp

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: h-inoue@dream.email.ne.jp, martial.guex@mutech.ch
  Subject: Re: Patch to solve memory protect violation and clear __error_number after call CC_lookup_characterset
  In-Reply-To: <152bdf12-5700-e640-3c75-eea299631129@dream.email.ne.jp>
  References: <f34835d637ff57e34084096df114ad49@mutech.ch> <152bdf12-5700-e640-3c75-eea299631129@dream.email.ne.jp>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox