diff options
author | Ritt Konstantin <ritt.ks@gmail.com> | 2010-03-10 11:30:09 (GMT) |
---|---|---|
committer | Benjamin Poulain <benjamin.poulain@nokia.com> | 2010-03-10 11:30:09 (GMT) |
commit | ab7939145a83884ba618440db9d887b272d48bbe (patch) | |
tree | b209919c070fe89b732b9ffa1b22f9aa8cbcef73 /src/gui/text/qzip.cpp | |
parent | 17ab2405fab50497c1f79c8e513fcfdf31979974 (diff) | |
download | Qt-ab7939145a83884ba618440db9d887b272d48bbe.zip Qt-ab7939145a83884ba618440db9d887b272d48bbe.tar.gz Qt-ab7939145a83884ba618440db9d887b272d48bbe.tar.bz2 |
Avoid asserting when index passed to QZipReader::entryInfoAt is out of boundaries
Reviewed-by: Benjamin Poulain <benjamin.poulain@nokia.com>
Diffstat (limited to 'src/gui/text/qzip.cpp')
-rw-r--r-- | src/gui/text/qzip.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/text/qzip.cpp b/src/gui/text/qzip.cpp index 5aa0a94..e2e0fb6 100644 --- a/src/gui/text/qzip.cpp +++ b/src/gui/text/qzip.cpp @@ -809,6 +809,7 @@ int QZipReader::count() const /*! Returns a FileInfo of an entry in the zipfile. The \a index is the index into the directoy listing of the zipfile. + Returns an invalid FileInfo if \a index is out of boundaries. \sa fileInfoList() */ @@ -816,7 +817,8 @@ QZipReader::FileInfo QZipReader::entryInfoAt(int index) const { d->scanFiles(); QZipReader::FileInfo fi; - d->fillFileInfo(index, fi); + if (index >= 0 && index < d->fileHeaders.count()) + d->fillFileInfo(index, fi); return fi; } |