summaryrefslogtreecommitdiff
path: root/binaryurp/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-06-02 16:38:12 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-06-02 16:38:12 +0100
commit1c6a1f54d5622d8a8a774472dad68e6e0f0cb7eb (patch)
treea64a73fbeb7ccabc765ef27654e95ffa300e5598 /binaryurp/source
parentcdabb18c5ffc9246455520dd86b90b1ba1fe5008 (diff)
round allocated struct return space to sizeof(size_t)
this fixes the sfx2 subsequenttest
Diffstat (limited to 'binaryurp/source')
-rw-r--r--binaryurp/source/incomingrequest.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/binaryurp/source/incomingrequest.cxx b/binaryurp/source/incomingrequest.cxx
index 646a868f6..e6dde0683 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)(