diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-07-03 11:17:37 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-03 12:49:39 +0100 |
commit | 5e043613266113a873c55ad45ab0fb1ae14286e8 (patch) | |
tree | bc3b52db9a7f7b156aa335dd99f0f0b2a3cd9f25 /lotuswordpro/source | |
parent | 6fb1f934d79fd04bc3ca36b446adad0b126e6b1c (diff) |
coverity#1222240 Untrusted value as argument
and
coverity#1222239 Untrusted value as argument
Change-Id: I48bacfd988a34d67ffa542edba7cba1bb9b0b3cc
Diffstat (limited to 'lotuswordpro/source')
-rw-r--r-- | lotuswordpro/source/filter/tocread.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lotuswordpro/source/filter/tocread.cxx b/lotuswordpro/source/filter/tocread.cxx index 90544df0ad6a..87b6bee8cee5 100644 --- a/lotuswordpro/source/filter/tocread.cxx +++ b/lotuswordpro/source/filter/tocread.cxx @@ -67,6 +67,16 @@ CBenTOCReader::ReadLabelAndTOC() if ((Err = ReadLabel(&TOCOffset, &cTOCSize)) != BenErr_OK) return Err; + unsigned long nLength; + if ((Err = cpContainer->GetSize(nLength)) != BenErr_OK) + return Err; + + if (TOCOffset > nLength) + return BenErr_ReadPastEndOfTOC; + + if (cTOCSize > nLength - TOCOffset) + return BenErr_ReadPastEndOfTOC; + if ((Err = cpContainer->SeekToPosition(TOCOffset)) != BenErr_OK) return Err; |