From 74c641c13e999d4978cfcc853845a93069fb8a29 Mon Sep 17 00:00:00 2001 From: Victor Salgado Date: Fri, 18 Sep 2015 14:36:22 -0300 Subject: [PATCH] Fix set initialization, set.OnlyCapsuleModeIsInvalid could be garbage --- src/Cedar/IPsec_IKE.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Cedar/IPsec_IKE.c b/src/Cedar/IPsec_IKE.c index ca8168aa..406ac2a4 100644 --- a/src/Cedar/IPsec_IKE.c +++ b/src/Cedar/IPsec_IKE.c @@ -4709,11 +4709,11 @@ bool GetBestTransformSettingForIPsecSa(IKE_SERVER *ike, IKE_PACKET *pr, IPSEC_SA if (transform_payload != NULL) { IKE_PACKET_TRANSFORM_PAYLOAD *transform = &transform_payload->Payload.Transform; - IPSEC_SA_TRANSFORM_SETTING set; + IPSEC_SA_TRANSFORM_SETTING *set = NULL; - if (TransformPayloadToTransformSettingForIPsecSa(ike, transform, &set, server_ip)) + if (TransformPayloadToTransformSettingForIPsecSa(ike, transform, set, server_ip)) { - Copy(setting, &set, sizeof(IPSEC_SA_TRANSFORM_SETTING)); + Copy(setting, set, sizeof(IPSEC_SA_TRANSFORM_SETTING)); setting->SpiServerToClient = READ_UINT(proposal->Spi->Buf); @@ -4721,11 +4721,11 @@ bool GetBestTransformSettingForIPsecSa(IKE_SERVER *ike, IKE_PACKET *pr, IPSEC_SA } else { - if (set.OnlyCapsuleModeIsInvalid) + if (set != NULL && set->OnlyCapsuleModeIsInvalid) { if (ocmii_flag == false) { - Copy(setting, &set, sizeof(IPSEC_SA_TRANSFORM_SETTING)); + Copy(setting, set, sizeof(IPSEC_SA_TRANSFORM_SETTING)); ocmii_flag = true; } }