aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Plate <elupus@ecce.se>2014-11-22 00:27:39 +0100
committerfritsch <Peter.Fruehberger@gmail.com>2014-12-29 12:17:35 +0100
commit12c66a27c322694551c8ece97f4f368bfab6d330 (patch)
tree37019fc117d9760d3f369ee5bf61ed03b303cc1f
parent494ef73f78e5dc0abae0f1ccc51c7fd8f43f3047 (diff)
fixed: CID 1248213 Unsigned compared against 0
An unsigned value can never be negative, so this test will always evaluate the same way. In XFILE::​CZipFile::​Read(void *, unsigned long): An unsigned value can never be less than 0 (CWE-570)
-rw-r--r--xbmc/filesystem/ZipFile.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/xbmc/filesystem/ZipFile.cpp b/xbmc/filesystem/ZipFile.cpp
index 7cc9c1d517..614b20fa5e 100644
--- a/xbmc/filesystem/ZipFile.cpp
+++ b/xbmc/filesystem/ZipFile.cpp
@@ -347,10 +347,10 @@ ssize_t CZipFile::Read(void* lpBuf, size_t uiBufSize)
{
if (uiBufSize+m_iFilePos > mZipItem.csize)
uiBufSize = mZipItem.csize-m_iFilePos;
- if (uiBufSize < 0)
- {
+
+ if (uiBufSize == 0)
return 0; // we are past eof, this shouldn't happen but test anyway
- }
+
ssize_t iResult = mFile.Read(lpBuf,uiBufSize);
if (iResult < 0)
return -1;