phpdave11 / gofpdi

Go Free PDF Document Importer
MIT License
119 stars 59 forks source link

Fix crashes induces by malformed compressed data #51

Open vsenko opened 2 years ago

vsenko commented 2 years ago

zlib.NewReader can return nil value in case of malformed compressed data (https://cs.opensource.google/go/go/+/refs/tags/go1.18.1:src/compress/zlib/reader.go;l=82), this would lead to a crash on an attempt to use zlibReader. Implemented error handling will eliminate such crashes.