[Poppler-bugs] [Bug 94378] Implement digital signature support (qt frontends)
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Tue Dec 6 23:30:09 UTC 2016
https://bugs.freedesktop.org/show_bug.cgi?id=94378
--- Comment #14 from Albert Astals Cid <aacid at kde.org> ---
You need to implemement the copy/assignment operators of
SignatureValidationInfo or make it not copiable/assignable, otherwise bad stuff
happens since the default implementations just do a = on the d_ptr, so when you
destroy it, there's a double delete on the d_ptr.
As proof, just add
Poppler::SignatureValidationInfo svi2 = svi;
in poppler-forms.cpp after the svi assignment and then running it with valgrind
(on a file that actually has signatures) and you'll get stuff like
==4234== Invalid read of size 8
==4234== at 0x4E85599: load (atomic_base.h:396)
==4234== by 0x4E85599: load<int> (qatomic_cxx11.h:96)
==4234== by 0x4E85599: load (qbasicatomic.h:116)
==4234== by 0x4E85599: deref (qrefcount.h:60)
==4234== by 0x4E85599: ~QString (qstring.h:1065)
==4234== by 0x4E85599: ~SignatureValidationInfoPrivate (poppler-form.cc:420)
==4234== by 0x4E85599:
Poppler::SignatureValidationInfo::~SignatureValidationInfo()
(poppler-form.cc:436)
==4234== by 0x10B18D: main (poppler-forms.cpp:189)
==4234== Address 0xf053f88 is 8 bytes inside a block of size 24 free'd
==4234== at 0x4C2E26B: operator delete(void*) (vg_replace_malloc.c:576)
==4234== by 0x10B185: main (poppler-forms.cpp:190)
==4234== Block was alloc'd at
==4234== at 0x4C2D1AF: operator new(unsigned long) (vg_replace_malloc.c:334)
==4234== by 0x4E856F2:
Poppler::FormFieldSignature::validate(Poppler::FormFieldSignature::ValidateOptions)
const (poppler-form.cc:483)
==4234== by 0x10AF29: main (poppler-forms.cpp:189)
==4234==
==4234== Invalid free() / delete / delete[] / realloc()
==4234== at 0x4C2E26B: operator delete(void*) (vg_replace_malloc.c:576)
==4234== by 0x10B18D: main (poppler-forms.cpp:189)
==4234== Address 0xf053f80 is 0 bytes inside a block of size 24 free'd
==4234== at 0x4C2E26B: operator delete(void*) (vg_replace_malloc.c:576)
==4234== by 0x10B185: main (poppler-forms.cpp:190)
==4234== Block was alloc'd at
==4234== at 0x4C2D1AF: operator new(unsigned long) (vg_replace_malloc.c:334)
==4234== by 0x4E856F2:
Poppler::FormFieldSignature::validate(Poppler::FormFieldSignature::ValidateOptions)
const (poppler-form.cc:483)
==4234== by 0x10AF29: main (poppler-forms.cpp:189)
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20161206/c980019a/attachment.html>
More information about the Poppler-bugs
mailing list