From 34dfc14549efb0ccc4e7b5f83daf720b1b2a63ea Mon Sep 17 00:00:00 2001 From: Evengard Date: Mon, 4 May 2020 16:05:50 +0300 Subject: [PATCH] Fixing errors discovered with Coverity. --- src/Cedar/Proto_PPP.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Cedar/Proto_PPP.c b/src/Cedar/Proto_PPP.c index 811cad74..9c6be569 100644 --- a/src/Cedar/Proto_PPP.c +++ b/src/Cedar/Proto_PPP.c @@ -257,9 +257,9 @@ void PPPThread(THREAD *thread, void *param) case PPP_EAP_TYPE_IDENTITY: default: // We treat the unspecified protocol as the IDENTITY protocol p->Eap_Protocol = PPP_EAP_TYPE_IDENTITY; - lcpEap = BuildEAPPacketEx(PPP_EAP_CODE_REQUEST, p->Eap_PacketId++, PPP_EAP_TYPE_IDENTITY, sizeof(welcomeMessage)); + lcpEap = BuildEAPPacketEx(PPP_EAP_CODE_REQUEST, p->Eap_PacketId++, PPP_EAP_TYPE_IDENTITY, StrLen(welcomeMessage) + 1); eapPacket = lcpEap->Data; - Copy(eapPacket->Data, welcomeMessage, sizeof(welcomeMessage)); + Copy(eapPacket->Data, welcomeMessage, StrLen(welcomeMessage)); PPPSetStatus(p, PPP_STATUS_AUTHENTICATING); if (!PPPSendAndRetransmitRequest(p, PPP_PROTOCOL_EAP, lcpEap)) { @@ -3447,7 +3447,7 @@ void FreePPPSession(PPP_SESSION *p) } if (p->Eap_TlsCtx.CachedBufferSend != NULL) { - Free(p->Eap_TlsCtx.CachedBufferRecv); + Free(p->Eap_TlsCtx.CachedBufferSend); } if (p->Eap_TlsCtx.SslPipe != NULL) {