Bug 145312 - Crash & missing pdf annotation in signed document (xmlsecurity, pdfium)
Summary: Crash & missing pdf annotation in signed document (xmlsecurity, pdfium)
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.3.0 target:7.4.0
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-25 12:03 UTC by Szymon Kłos
Modified: 2022-05-05 13:19 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Signed PDF with 2 dummy signatures (144.83 KB, application/pdf)
2021-10-25 12:03 UTC, Szymon Kłos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Szymon Kłos 2021-10-25 12:03:02 UTC
Created attachment 175906 [details]
Signed PDF with 2 dummy signatures

Steps to reproduce:
1. Open LibreOffice
2. Open attached pdf file (Signed PDF with 2 dummy signatures)

Result: crash

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: bba6a4ed92a0feb288a9dedd648d623bee02a3ce
CPU threads: 16; OS: Linux 5.3; UI render: default; VCL: gtk3
Locale: pl-PL (pl_PL.utf8); UI: en-US
Calc: threaded

Code pointers:
Crash place: https://opengrok.libreoffice.org/xref/core/xmlsecurity/source/helper/pdfsignaturehelper.cxx?r=5cd87f19#278

Null pointer because getAnnotation failed:
https://opengrok.libreoffice.org/xref/core/vcl/source/pdf/PDFiumLibrary.cxx?r=8cecaa62#698
Comment 1 Commit Notification 2021-10-25 12:05:43 UTC
Szymon Kłos committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/97b15bcc2d15dd754afbfbf8709fa62a9866160e

tdf#145312 xmlsecurity: prevent from crash when cannot receive pdfium annotation

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 2 Szymon Kłos 2021-10-25 12:07:30 UTC
I pushed a guard to prevent from crashing but bug is not solved. There are 2 signatures in this document but only one is shown in "File -> Digital signatures -> Digital signatures..." dialog.
Comment 3 Xisco Faulí 2022-05-03 12:27:07 UTC
Dear Szymon Kłos,
This bug has been in ASSIGNED status for more than 3 months without any
activity. Resetting it to NEW.
Please assign it back to yourself if you're still working on this.
Comment 4 Xisco Faulí 2022-05-05 10:24:36 UTC
Issue verified in

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 08c979e235aa993f50e54224f8c715bb70697c33
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded

Closing as VERIFIED FIXED
Comment 5 Commit Notification 2022-05-05 13:19:24 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4351a6ca782e1d2081ba819338ebbf6a2d2ee2b2

tdf#145312: xmlsecurity_pdfsigning: Add unittest

It will be available in 7.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.