]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Handle errors from zlib/pako
authorNiko Lehto <nikle@cendio.se>
Mon, 3 Feb 2020 09:04:20 +0000 (10:04 +0100)
committerNiko Lehto <nikle@cendio.se>
Mon, 17 Feb 2020 10:29:41 +0000 (11:29 +0100)
core/inflator.js

index 726600f98af710c89dad2ccab4529d9aee4ca324..39db447a10250c9e8d3edbd9a20279a0e1f77bda 100644 (file)
@@ -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");