OpenSC/OpenSC — pull request #231 by LudovicRousseau (2014-04-10 14:45:34+00:00)
Title: pkcs11-tool: check for buffer overflows

Check the subject, issuer and serialNumber will encode in the allocated
space before copying the data.

Thanks to Umberto Rustichelli for the bug report
https://sourceforge.net/p/opensc/mailman/message/32210626/

Note: UNTESTED code. But it should be OK.