dealfonso / sapp

Simple and Agnostic PDF Document Parser in PHP - sign PDF docs using PHP
GNU Lesser General Public License v3.0
110 stars 29 forks source link

Fix Uninitialized string offset -1 #38

Closed erikn69 closed 1 year ago

erikn69 commented 1 year ago
Uninitialized string offset -1

/home/runner/work/FPDF-1/FPDF-1/vendor/ddn/sapp/src/PDFObjectParser.php:220
/home/runner/work/FPDF-1/FPDF-1/vendor/ddn/sapp/src/PDFObjectParser.php:274
/home/runner/work/FPDF-1/FPDF-1/vendor/ddn/sapp/src/PDFObjectParser.php:363
/home/runner/work/FPDF-1/FPDF-1/vendor/ddn/sapp/src/PDFObjectParser.php:395
/home/runner/work/FPDF-1/FPDF-1/vendor/ddn/sapp/src/PDFObjectParser.php:345
/home/runner/work/FPDF-1/FPDF-1/vendor/ddn/sapp/src/PDFObjectParser.php:392
/home/runner/work/FPDF-1/FPDF-1/vendor/ddn/sapp/src/PDFObjectParser.php:150
/home/runner/work/FPDF-1/FPDF-1/vendor/ddn/sapp/src/PDFObjectParser.php:157
/home/runner/work/FPDF-1/FPDF-1/vendor/ddn/sapp/src/PDFUtilFnc.php:52
/home/runner/work/FPDF-1/FPDF-1/vendor/ddn/sapp/src/PDFUtilFnc.php:343
/home/runner/work/FPDF-1/FPDF-1/vendor/ddn/sapp/src/PDFUtilFnc.php:379

Try those pdfs ex.pdf test_protection.pdf

After this change encrypted documents are not fully supported; maybe you cannot get the expected results is displayed as expected

Error info at PDFDoc.php:151: encrypted documents are not fully supported; maybe you cannot get the expected results
dealfonso commented 1 year ago

Thank you for detecting and correcting the bug!