From 78729e76da07c7eda05e63469faaaff7eb6ab80d Mon Sep 17 00:00:00 2001 From: Marc Hoersken Date: Fri, 13 Apr 2012 13:02:59 +0200 Subject: [PATCH] schannel: Fixed critical typo in conditions and added buffer length checks --- lib/curl_schannel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/curl_schannel.c b/lib/curl_schannel.c index 3de8e7c01..6bc768219 100644 --- a/lib/curl_schannel.c +++ b/lib/curl_schannel.c @@ -336,7 +336,7 @@ schannel_connect_step2(struct connectdata *conn, int sockindex) { if(sspi_status == SEC_I_CONTINUE_NEEDED || sspi_status == SEC_E_OK) { for(i = 0; i < 2; i++) { /* search for handshake tokens that need to be send */ - if(outbuf[i].BufferType = SECBUFFER_TOKEN && outbuf[i].cbBuffer > 0) { + if(outbuf[i].BufferType == SECBUFFER_TOKEN && outbuf[i].cbBuffer > 0) { infof(data, "schannel: sending next handshake data: %d ...\n", outbuf[i].cbBuffer); @@ -369,7 +369,7 @@ schannel_connect_step2(struct connectdata *conn, int sockindex) { } /* check if there was additional remaining encrypted data */ - if(inbuf[1].BufferType = SECBUFFER_EXTRA) { + if(inbuf[1].BufferType == SECBUFFER_EXTRA && inbuf[1].cbBuffer > 0) { infof(data, "schannel: encrypted data length: %d\n", inbuf[1].cbBuffer); /* check if the remaining data is less than the total amount @@ -789,7 +789,7 @@ schannel_recv(struct connectdata *conn, int sockindex, } /* check for remaining encrypted data */ - if(inbuf[3].BufferType = SECBUFFER_EXTRA) { + if(inbuf[3].BufferType == SECBUFFER_EXTRA && inbuf[3].cbBuffer > 0) { infof(data, "schannel: encrypted data length: %d\n", inbuf[3].cbBuffer); /* check if the remaining data is less than the total amount