]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
TNC: Fix TNC_{TNCC,TNCS}_ReportMessageTypes copy type
authorJouni Malinen <jouni.malinen@atheros.com>
Wed, 13 Apr 2011 20:10:21 +0000 (23:10 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 13 Apr 2011 20:10:21 +0000 (23:10 +0300)
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.

src/eap_peer/tncc.c
src/eap_server/tncs.c

index eaaa1689b58ff99f65e7907dbf980c9abfda30e4..a70d70ccd6a6d8269c2775309908dac808ad924b 100644 (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;
index 497b51a0f3e5e944a5933fd095e32649647f327c..637b6f88de42738963c0e53be6edc59bb270e08e 100644 (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;