Avoid undefined negation behavior if windowBits is INT_MIN.
This commit is contained in:
parent
138c93cffb
commit
a9e14e8541
@ -279,6 +279,8 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
|
|||||||
|
|
||||||
if (windowBits < 0) { /* suppress zlib wrapper */
|
if (windowBits < 0) { /* suppress zlib wrapper */
|
||||||
wrap = 0;
|
wrap = 0;
|
||||||
|
if (windowBits < -15)
|
||||||
|
return Z_STREAM_ERROR;
|
||||||
windowBits = -windowBits;
|
windowBits = -windowBits;
|
||||||
}
|
}
|
||||||
#ifdef GZIP
|
#ifdef GZIP
|
||||||
|
@ -168,6 +168,8 @@ int windowBits;
|
|||||||
|
|
||||||
/* extract wrap request from windowBits parameter */
|
/* extract wrap request from windowBits parameter */
|
||||||
if (windowBits < 0) {
|
if (windowBits < 0) {
|
||||||
|
if (windowBits < -15)
|
||||||
|
return Z_STREAM_ERROR;
|
||||||
wrap = 0;
|
wrap = 0;
|
||||||
windowBits = -windowBits;
|
windowBits = -windowBits;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user