summaryrefslogtreecommitdiff
path: root/io
diff options
context:
space:
mode:
authorDaniel Rentz [dr] <daniel.rentz@oracle.com>2011-02-28 10:08:33 +0100
committerDaniel Rentz [dr] <daniel.rentz@oracle.com>2011-02-28 10:08:33 +0100
commit09c5b76f9fe83f44f1c4f98a06ea0fb3340ff652 (patch)
tree5bfbfafc4a8ab0b710cdae3db6781b6382f38289 /io
parentdf3c96438b18b0fa86e292ba7fd51a884ae50282 (diff)
parentb49ffdd047b49e52f26430d53705f8f8657433d7 (diff)
dr78: rebase to DEV300_m101
Diffstat (limited to 'io')
-rw-r--r--io/source/acceptor/acc_pipe.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/io/source/acceptor/acc_pipe.cxx b/io/source/acceptor/acc_pipe.cxx
index c38fb0555..cbabb95be 100644
--- a/io/source/acceptor/acc_pipe.cxx
+++ b/io/source/acceptor/acc_pipe.cxx
@@ -101,11 +101,17 @@ namespace io_acceptor
{
if( ! m_nStatus )
{
- if( aReadBytes.getLength() != nBytesToRead )
+ if( aReadBytes.getLength() < nBytesToRead )
{
aReadBytes.realloc( nBytesToRead );
}
- return m_pipe.read( aReadBytes.getArray() , aReadBytes.getLength() );
+ sal_Int32 n = m_pipe.read( aReadBytes.getArray(), nBytesToRead );
+ OSL_ASSERT( n >= 0 && n <= aReadBytes.getLength() );
+ if( n < aReadBytes.getLength() )
+ {
+ aReadBytes.realloc( n );
+ }
+ return n;
}
else {
throw IOException();