Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NPE when adding illegal child to nameless PdfLayer #43

Closed
wants to merge 1 commit into from

Conversation

salsolatragus
Copy link

When a PdfLayer is created without a name, e.g., via PdfLayer.createTitle() or when reading OCProperties, and later a child that has already another parent is added to this layer, the addChild(PdfLayer) method throws a NullPointerException. The is because the name is retrieved and immediately converted to a Unicode string, even if it is null.

This problem was identified by our automated detector MUDetect. We would very much appreciate your feedback on our patch. Thank you very much!

When a PdfLayer is created without a name, e.g., via PdfLayer.createTitle() or
when reading OCProperties, and later a child that has already another parent
is added to this layer, the addChild(PdfLayer) method throws a
NullPointerException. The is because the name is retrieved and immediately
converted to a Unicode string, even if it is null.
@iText-CI
Copy link
Contributor

Can one of the admins verify this patch?

@avlemos
Copy link

avlemos commented Apr 30, 2019

Hi @salsolatragus,

Right now itext/itextpdf has been deprecated in favor of itext/itext7, although we will continue to incorporate security fixes in itext/itextpdf (iText5).

Could you check if the issue exists in itext/itext7 so we can incorporate your fix?

Thank you for contribution, it is appreciated.

@avlemos avlemos closed this Apr 30, 2019
@salsolatragus
Copy link
Author

@avlemos the problem is fixed in itext7.

@andreasrosdal: I've migrated this PR to OpenPDF5, too: LibrePDF#2

@andreasrosdal
Copy link

@salsolatragus Thanks!

@andreasrosdal
Copy link

Are any of these relevant for https://github.com/LibrePDF/OpenPDF also?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants