Menu

#53 App_free on CDSA heap memory!!

Low_Severity
open
nobody
5
2001-09-24
2001-09-24
Anonymous
No

The code for CL_getAllFields from
addins/intel/cssmcl/x509v3cl/crtgetal.c appears to
switch between returning FieldValue data allocated via
the application's allocation function and that from its
own heap.

In the case of using data from CDSA's own heap, in
CL_FreeFields (from freefld.c) which the spec says to
use on result of the above function, these two cases
are missing (given that they are singled out for
special treatment in the above function):

case INT_IssuerNameLDAP:
case INT_SubjectNameLDAP:

which results, by default, in App_free being called.
Further, the following cases are accounted for but the
code explicitly calls App_free when no application
allocation was actually made (although some sort of
test is made, but App_free is being called anyway):

case INT_IssuerNameCStruct:
case INT_SubjectNameCStruct:
case INT_SubjectPublicKeyCStruct:
case INT_SignatureCStruct:
case INT_CertificateCStruct:
case INT_CertificateExtensionsCStruct:

So app free is being used on cdsa memory addresses in
two erroneous ways.

Discussion