[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - 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 97e0b6d1810fcc9d84da108fb470aaf7b8ea4a37
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/13796
    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 3f8e85f..442a2a5 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