summaryrefslogtreecommitdiff
path: root/hwpfilter
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2014-07-01 16:10:11 +0200
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-07-01 16:20:00 +0200
commit31050012a4010f44f8cf4698824f6f806ed1f3b2 (patch)
treeb8b835bb322db1261609b8f645b17f0e399beaf8 /hwpfilter
parente50ef195bc95f3f410119f623928382cb88b45d2 (diff)
coverity#1202814 Overflowed return value
Change-Id: Ifc07a0b3f09dc1209e434056eb007a4401a09d3e
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/hgzip.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/hwpfilter/source/hgzip.cxx b/hwpfilter/source/hgzip.cxx
index 20f40d26855b..6b7e0b973e8e 100644
--- a/hwpfilter/source/hgzip.cxx
+++ b/hwpfilter/source/hgzip.cxx
@@ -284,15 +284,15 @@ int gz_flush(gz_stream * file, int flush)
*/
local uLong getLong(gz_stream * s)
{
- uLong x = (uLong) get_byte(s);
- int c;
+ uLong x = (unsigned char) get_byte(s);
- x += ((uLong) get_byte(s)) << 8;
- x += ((uLong) get_byte(s)) << 16;
- c = get_byte(s);
- if (c == EOF)
+ x += ((unsigned char) get_byte(s)) << 8;
+ x += ((unsigned char) get_byte(s)) << 16;
+ x += ((unsigned char) get_byte(s)) << 24;
+ if (s->z_eof)
+ {
s->z_err = Z_DATA_ERROR;
- x += ((uLong) c) << 24;
+ }
return x;
}