Created attachment 135716 [details] [review] SignatureHandler-calloc.patch Inside SignatureHandler.cc and specifically in SignatureHandler::getSignerSubjectDN() the subjectName of cert is read and returned back to validateSignature() of Form.cc and then to pdfsig.cc. Returning to pdfsig.cc though signature_handler is destroyed and as a result the pointer to subjectName is invalid. I am attaching a small patch that allocates memory for subjectName before returning to avoid segfault but this memory should be freed after usage. The patch attached is an example, not as a patch to be merged to master :-)
Forgot to post url of pdf that causes the segfault: https://blogs.adobe.com/security/SampleSignedPDFDocument.pdf
There's lots of wrong stuff in signature handling memory it seems. This is the valgrind trace i get when running pdfsig with valgrind on that document https://paste.kde.org/pnfcsuhj8 Adding the people that have worked on signature handling to see if they can provide a fix.
Created attachment 136041 [details] [review] subjectdn_mem_alloc.patch I attach a patch that handles auto removing memory allocated for subject DN as a proposed patch against master.
Fixed with my last few commits to master.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.