Fix crash in __pmDecodeCreds handling corrupt PDUs
Resolve problem decoding the credentials PDU where the numcreds field
exceeds the number of elements actually contained in the PDU.
On 32-bit architectures, the size passed to malloc can be too small,
leading to a heap-based buffer overflow. On 64-bit architectures,
the multiplication is performed with 64 bits, so no overflow occurs,
and the crash happens because __pmDecodeCreds reads beyond the end of
an allocated buffer.
Original report and patch review by Florian Weimer with the Red Hat
Security Team. Red Hat bugzilla bug #840822.
Security advisory CVE-2012-3418.