summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2015-01-07 15:56:12 +0100
committerAndras Timar <andras.timar@collabora.com>2015-01-08 15:09:38 +0100
commitbe2947e8baa85f7951907081ff51f86b550ae2b4 (patch)
tree81ffa1c8e85282d0cbbe7258d869dafac73cbe6a /connectivity
parente910de2501e6aed82e01930478ed7a14cfd0836a (diff)
protect agains past-the-end string access
Change-Id: I651c7b062b454fad85eff8852f7e62804a0d0058 Reviewed-on: https://gerrit.libreoffice.org/13798 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit cd0700994b4ced5cfb8504c1b58ebfdbc3515674)
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/postgresql/pq_tools.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx
index ff89568e214e..3610dbb5199c 100644
--- a/connectivity/source/drivers/postgresql/pq_tools.cxx
+++ b/connectivity/source/drivers/postgresql/pq_tools.cxx
@@ -423,7 +423,7 @@ void splitSQL( const OString & sql, OStringVector &vec )
}
else if( singleQuote )
{
- if( '\'' == c && '\'' == sql[i+1] )
+ if( '\'' == c && (i+1) < length && '\'' == sql[i+1] )
{
// two subsequent single quotes within a quoted string
// mean a single quote within the string