heimdal: Fix CID 240779 Allocation size mismatch
commit56bcd356d880e8959474a969ffa438f44d8a7b19
authorVolker Lendecke <vl@samba.org>
Tue, 12 Nov 2013 21:00:54 +0000 (12 22:00 +0100)
committerNicolas Williams <nico@cryptonector.com>
Tue, 25 Mar 2014 04:07:51 +0000 (24 23:07 -0500)
tree059d82cf1cbb747cc237b39c69ddc406ee194d1c
parent2aca5c4faef2914a1227bb8a635281793ef8bc6e
heimdal: Fix CID 240779 Allocation size mismatch

(rebased on current Heimdal by abartlet)

The error Coverity complains about is in the malloc. krb5_enctypes is
an enum, so it is usually smaller than the size of a pointer. So we
overallocate, but in the memcpy further down we copy from potentially
invalid memory.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Nov 13 11:05:44 CET 2013 on sn-devel-104
lib/krb5/context.c