Skip to content

Commit

Permalink
check for array bounds before accessing the array
Browse files Browse the repository at this point in the history
  • Loading branch information
davecramer committed Apr 27, 2012
1 parent 557d6f3 commit 64d493d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion org/postgresql/util/ServerErrorMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public ServerErrorMessage(String p_serverError, int verbosity)
{
l_pos++;
int l_startString = l_pos;
while (l_chars[l_pos] != '\0' && l_pos < l_length)
// order here is important position must be checked before accessing the array
while ( l_pos < l_length && l_chars[l_pos] != '\0' )
{
l_pos++;
}
Expand Down

0 comments on commit 64d493d

Please sign in to comment.