TNC: Fix TNC_{TNCC,TNCS}_ReportMessageTypes copy type

The supportedTypes parameter is a list of TNC_MessageType values
and the buffer to be copied should use size of TNC_MessageType, not
TNC_MessageTypeList. In practice, these are of same length on most
platforms, so this is not a critical issue, but anyway, the correct
type should be used.
This commit is contained in:
Jouni Malinen 2011-04-13 23:10:21 +03:00 committed by Jouni Malinen
parent a04bf77209
commit f8b5f7dc6b
2 changed files with 4 additions and 4 deletions

View file

@ -180,11 +180,11 @@ TNC_Result TNC_TNCC_ReportMessageTypes(
imc = tnc_imc[imcID];
os_free(imc->supported_types);
imc->supported_types =
os_malloc(typeCount * sizeof(TNC_MessageTypeList));
os_malloc(typeCount * sizeof(TNC_MessageType));
if (imc->supported_types == NULL)
return TNC_RESULT_FATAL;
os_memcpy(imc->supported_types, supportedTypes,
typeCount * sizeof(TNC_MessageTypeList));
typeCount * sizeof(TNC_MessageType));
imc->num_supported_types = typeCount;
return TNC_RESULT_SUCCESS;

View file

@ -234,11 +234,11 @@ TNC_Result TNC_TNCS_ReportMessageTypes(
return TNC_RESULT_INVALID_PARAMETER;
os_free(imv->supported_types);
imv->supported_types =
os_malloc(typeCount * sizeof(TNC_MessageTypeList));
os_malloc(typeCount * sizeof(TNC_MessageType));
if (imv->supported_types == NULL)
return TNC_RESULT_FATAL;
os_memcpy(imv->supported_types, supportedTypes,
typeCount * sizeof(TNC_MessageTypeList));
typeCount * sizeof(TNC_MessageType));
imv->num_supported_types = typeCount;
return TNC_RESULT_SUCCESS;