Re: Possible bug in ServerErrorMessage.java

Поиск
Список
Период
Сортировка
От Maciek Sakrejda
Тема Re: Possible bug in ServerErrorMessage.java
Дата
Msg-id CAH_hXRbsLzYBex1AdD+UW1bZdQCkoKTYf5e7_pOSNSTSytH6eQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Possible bug in ServerErrorMessage.java  (Dave Cramer <pg@fastcrypt.com>)
Ответы Re: Possible bug in ServerErrorMessage.java  (Fedechicco <fedechicco@gmail.com>)
Re: Possible bug in ServerErrorMessage.java  ("ml-tb" <ml-tb@emagixx.de>)
Список pgsql-jdbc
> From what I've seen the line 48 and the following are:
>
> while (l_chars[l_pos] != '\0' && l_pos < l_length)
> {
>         l_pos++;
> }
>
> which IMO should be changed in:
> while (l_pos < l_length && l_chars[l_pos] != '\0')

This seems to be the code in question, to decode the wire ErrorResponse message:

https://github.com/pgjdbc/pgjdbc/blob/master/org/postgresql/util/ServerErrorMessage.java#L32

Although what you suggested would be more defensive coding, if you
look at the message specification [1], I believe the current code
*should* process any well-formed ErrorResponse message correctly. As
Dave asked, is this consistently reproducible? Also, are you in a
position to make the change you suggested, rebuild the driver, and
retry it yourself? If so, do you get a different message?

[1]: http://www.postgresql.org/docs/9.1/static/protocol-message-formats.html
---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com

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

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: Possible bug in ServerErrorMessage.java
Следующее
От: Fedechicco
Дата:
Сообщение: Re: Possible bug in ServerErrorMessage.java