[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - connectivity/source
Lionel Elie Mamane
lionel at mamane.lu
Wed Jan 7 07:13:11 PST 2015
connectivity/source/drivers/postgresql/pq_tools.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit cd0700994b4ced5cfb8504c1b58ebfdbc3515674
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date: Wed Jan 7 15:56:12 2015 +0100
protect agains past-the-end string access
Change-Id: I651c7b062b454fad85eff8852f7e62804a0d0058
Reviewed-on: https://gerrit.libreoffice.org/13798
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx
index ff89568..3610dbb 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
More information about the Libreoffice-commits
mailing list