Issue 94845 - don't crash on bad binary files ...
Summary: don't crash on bad binary files ...
Status: CLOSED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: code (show other issues)
Version: OOo 3.0
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 3.0.1
Assignee: mikhail.voytenko
QA Contact: Unknown
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-10 15:18 UTC by mmeeks
Modified: 2009-07-20 15:59 UTC (History)
1 user (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description mmeeks 2008-10-10 15:18:11 UTC
Index: source/sdstor/stgstrms.cxx
===================================================================
RCS file: /cvs/util/sot/source/sdstor/stgstrms.cxx,v
retrieving revision 1.11
diff -u -p -r1.11 stgstrms.cxx
--- sot/source/sdstor/stgstrms.cxx
+++ sot/source/sdstor/stgstrms.cxx
@@ -823,6 +823,8 @@ void* StgDataStrm::GetPtr( INT32 Pos, BO
 
 INT32 StgDataStrm::Read( void* pBuf, INT32 n )
 {
+    if (n < 0)
+        return 0;
     if( ( nPos + n ) > nSize )
         n = nSize - nPos;
     INT32 nDone = 0;
Comment 1 mikhail.voytenko 2008-10-10 15:38:23 UTC
Thank you for the patch. I will integrate it in one of the next framework cwss.
Comment 2 mikhail.voytenko 2008-10-27 09:02:30 UTC
Integrated in cws fwk94.
Comment 3 mikhail.voytenko 2008-10-30 10:21:03 UTC
Development issue.
Comment 4 thorsten.ziehm 2009-07-20 15:59:40 UTC
This issue is closed automatically and wasn't rechecked in a current version of
OOo. The fixed issue should be integrated in OOo since more than half a year. If
you think this issue isn't fixed in a current version (OOo 3.1), please reopen
it and change the field 'Target Milestone' accordingly.

If you want to download a current version of OOo =>
http://download.openoffice.org/index.html
If you want to know more about the handling of fixed/verified issues =>
http://wiki.services.openoffice.org/wiki/Handle_fixed_verified_issues