Kaydet (Commit) 31050012 authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

coverity#1202814 Overflowed return value

Change-Id: Ifc07a0b3f09dc1209e434056eb007a4401a09d3e
üst e50ef195
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment