BUG #1449: JDBC client driver bug waiting to happen

Поиск
Список
Период
Сортировка
От Michael Robinton
Тема BUG #1449: JDBC client driver bug waiting to happen
Дата
Msg-id 20050128193415.60B159A582B@www.postgresql.com
обсуждение исходный текст
Ответы Re: BUG #1449: JDBC client driver bug waiting to happen  (Kris Jurka <books@ejurka.com>)
Список pgsql-bugs
The following bug has been logged online:

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

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.

Michael

/*
         * 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;

                try
                {
                        for (int i = 0 ; i < siz ; i++)
                        {
                                int b = pg_input.read();

                                if (b < 0)
                                        throw new
PSQLException("postgresql.stream.eof", PSQLState.COMMUNICATION_ERROR);
                                n = n | (b << (8 * i)) ;

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "Olleg Samoylov"
Дата:
Сообщение: BUG #1447: Sometimes rules don't work
Следующее
От: "Nikola Ivanov"
Дата:
Сообщение: BUG #1448: pgAdmin III crashes on insert/update/delete