Re: unixODBC (again)

From: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
To: Nick Gorham <nick(at)easysoft(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: unixODBC (again)
Date: 2001-02-08 00:35:21
Message-ID: 3A81E9C9.4104C3FD@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-odbc

Nick Gorham wrote:

>
> Then having sorted this out, I get a core dump, that I have traced to
> CC_lookup_pg_version, the code did
>
> CC_lookup_pg_version(ConnectionClass *self)
> {
> HSTMT hstmt;
> StatementClass *stmt;
> RETCODE result;
> char *szVersion = "0.0";
> static char *func = "CC_lookup_pg_version";
>
> Then later did a
>
> sprintf( szVersion... );
>
> This seems to be trying to write into, what the compiler is marking as
> read only storage. A quick change to
>

You are right, it seems a misuse of char *.

> CC_lookup_pg_version(ConnectionClass *self)
> {
> HSTMT hstmt;
> StatementClass *stmt;
> RETCODE result;
> char szVersion[ 3 ];
> static char *func = "CC_lookup_pg_version";
>
> strcpy( szVersion, "0.0" );
>

szVersion[3] seems too short.
I would increase the length and commit it soon.

Regards,
Hiroshi Inoue

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-02-08 00:45:30 Re: preproc.y error
Previous Message Philip Warner 2001-02-07 23:43:17 Re: pg_dump: oldie but goldie

Browse pgsql-odbc by date

  From Date Subject
Next Message Hiroshi Inoue 2001-02-08 09:27:46 Re: Visio, new DLL
Previous Message Peter Eisentraut 2001-02-07 18:43:06 Re: unixODBC (again)