[Libreoffice-commits] .: Branch 'libreoffice-3-4' - binaryurp/source

Noel Power noelp at kemper.freedesktop.org
Wed Aug 10 09:05:44 PDT 2011


 binaryurp/source/incomingrequest.cxx |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 342601dbbcd571dd72ad4a1d67ff6f6d20b47134
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jun 2 16:38:12 2011 +0100

    round allocated struct return space to sizeof(size_t)
    
    this fixes the sfx2 subsequenttest
    
    Signed-off-by: Noel Power <noel.power at novell.com>

diff --git a/binaryurp/source/incomingrequest.cxx b/binaryurp/source/incomingrequest.cxx
index 646a868..e6dde06 100644
--- a/binaryurp/source/incomingrequest.cxx
+++ b/binaryurp/source/incomingrequest.cxx
@@ -131,6 +131,11 @@ void IncomingRequest::execute() const {
     }
 }
 
+static size_t size_t_round(size_t val)
+{
+    return (val + (sizeof(size_t)-1)) & ~(sizeof(size_t)-1);
+}
+
 bool IncomingRequest::execute_throw(
     BinaryAny * returnValue, std::vector< BinaryAny > * outArguments) const
 {
@@ -246,7 +251,10 @@ bool IncomingRequest::execute_throw(
                 OSL_ASSERT(false); // this cannot happen
                 break;
             }
-            std::vector< char > retBuf(retType.is() ? retType.get()->nSize : 0);
+            size_t nSize = 0;
+            if (retType.is())
+                nSize = size_t_round(retType.get()->nSize);
+            std::vector< char > retBuf(nSize);
             uno_Any exc;
             uno_Any * pexc = &exc;
             (*object_.get()->pDispatcher)(


More information about the Libreoffice-commits mailing list