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

BUG #1449: JDBC client driver bug waiting to happen

From: "Michael Robinton" <michael(at)insulin-pumpers(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1449: JDBC client driver bug waiting to happen
Date: 2005-01-28 19:34:15
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      1449
Logged by:          Michael Robinton
Email address:      michael(at)insulin-pumpers(dot)org
PostgreSQL version: 7.4.6
Operating system:   linux
Description:        JDBC client driver bug waiting to happen

if "int size" is set to 8, there is insufficient storage in "int n" to
accomodate 8 bytes of storage since jave thinks an int is 4 bytes. Since
currently no 8 byte longs are sent, this bug is not apparent.


         * Receives an integer from the backend
         * @param siz length of the integer in bytes
         * @return the integer received from the backend
         * @exception SQLException if an I/O error occurs
        public int ReceiveInteger(int siz) throws SQLException
                int n = 0;

                        for (int i = 0 ; i < siz ; i++)
                                int b =;

                                if (b < 0)
                                        throw new
                                n = n | (b << (8 * i)) ;


pgsql-bugs by date

Next:From: Dirk CapDate: 2005-01-28 20:49:51
Subject: wcwidth
Previous:From: Gaetano MendolaDate: 2005-01-28 18:54:52
Subject: Re: BUG #1439: unable to create more than 21 database connections

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