summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2015-01-07 15:56:12 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-01-07 15:11:58 +0000
commit97e0b6d1810fcc9d84da108fb470aaf7b8ea4a37 (patch)
tree3863e99fc2a342858c99a01e4ae957e85a74f831 /connectivity
parent7d2345da68a4149b65cc78000088f887a203686c (diff)
protect agains past-the-end string access
Change-Id: I651c7b062b454fad85eff8852f7e62804a0d0058 Reviewed-on: https://gerrit.libreoffice.org/13796 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
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 3f8e85fb7c74..442a2a56d2bc 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