Tag: cws_dev300_dba31c
User: fs      
Date: 2008-09-10 12:37:50+0000
Modified:
   dba/connectivity/source/drivers/jdbc/PreparedStatement.cxx

Log:
 #i92638# even more tolerance: what if readBytes lies in its return value?

File Changes:

Directory: /dba/connectivity/source/drivers/jdbc/
=================================================

File [changed]: PreparedStatement.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/jdbc/PreparedStatement.cxx?r1=1.24.64.2&r2=1.24.64.3
Delta lines:  +8 -4
-------------------
--- PreparedStatement.cxx       2008-09-10 12:36:27+0000        1.24.64.2
+++ PreparedStatement.cxx       2008-09-10 12:37:47+0000        1.24.64.3
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: PreparedStatement.cxx,v $
- * $Revision: 1.24.64.2 $
+ * $Revision: 1.24.64.3 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -647,8 +647,10 @@
                        mID  = t.pEnv->GetMethodID( getMyClass(), cMethodName, 
cSignature );OSL_ENSURE(mID,"Unknown method id!");
                if( mID )
                {
-                       Sequence< sal_Int8> aSeq;
-            sal_Int32 actualLength = x.is() ? x->readBytes( aSeq, length ) : 0;
+                       Sequence< sal_Int8 > aSeq;
+            if ( x.is() )
+                x->readBytes( aSeq, length );
+            sal_Int32 actualLength = aSeq.getLength();
 
                        jvalue args2[3];
                        jbyteArray pByteArray = t.pEnv->NewByteArray( 
actualLength );
@@ -696,7 +698,9 @@
                if( mID )
                {
                        Sequence< sal_Int8 > aSeq;
-            sal_Int32 actualLength = x.is() ? x->readBytes( aSeq, length ) : 0;
+            if ( x.is() )
+                x->readBytes( aSeq, length );
+            sal_Int32 actualLength = aSeq.getLength();
 
                        jvalue args2[3];
             jbyteArray pByteArray = t.pEnv->NewByteArray(actualLength);




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to