diff options
author | Niko Lehto <nikle@cendio.se> | 2020-02-03 10:04:20 +0100 |
---|---|---|
committer | Niko Lehto <nikle@cendio.se> | 2020-02-17 11:29:41 +0100 |
commit | 3cf11004b476b66296714e0d7b85437d40604cc3 (patch) | |
tree | 0fbf17aa71bbdf062b056c52af8b7e353299119c | |
parent | f6669ff7b2e489f0a55d2808ede674e64f777e7d (diff) | |
download | novnc-3cf11004b476b66296714e0d7b85437d40604cc3.tar.gz |
Handle errors from zlib/pako
-rw-r--r-- | core/inflator.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/inflator.js b/core/inflator.js index 726600f..39db447 100644 --- a/core/inflator.js +++ b/core/inflator.js @@ -35,7 +35,10 @@ export default class Inflate { this.strm.avail_out = this.chunkSize; - inflate(this.strm, 0); // Flush argument not used. + let ret = inflate(this.strm, 0); // Flush argument not used. + if (ret < 0) { + throw new Error("zlib inflate failed"); + } if (this.strm.next_out != expected) { throw new Error("Incomplete zlib block"); |