From c0d15f1245f895cebd4aa66e24e5e82898144b8f Mon Sep 17 00:00:00 2001 From: Todd A Ouska Date: Sun, 8 May 2011 11:35:24 -0700 Subject: [PATCH] fix alert size on send --- src/cyassl_int.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cyassl_int.c b/src/cyassl_int.c index da4250ce7..d30561dd7 100644 --- a/src/cyassl_int.c +++ b/src/cyassl_int.c @@ -2895,7 +2895,7 @@ int ReceiveData(SSL* ssl, byte* output, int sz) /* send alert message */ int SendAlert(SSL* ssl, int severity, int type) { - byte input[ALERT_SIZE + MAX_MSG_EXTRA]; + byte input[ALERT_SIZE]; byte *output; int sendSz; int ret; @@ -2920,15 +2920,15 @@ int SendAlert(SSL* ssl, int severity, int type) input[1] = type; if (ssl->keys.encryptionOn) - sendSz = BuildMessage(ssl, output, input, sizeof(input), alert); + sendSz = BuildMessage(ssl, output, input, ALERT_SIZE, alert); else { RecordLayerHeader *const rl = (RecordLayerHeader*)output; rl->type = alert; rl->version = ssl->version; c16toa(ALERT_SIZE, rl->length); - XMEMCPY(output + RECORD_HEADER_SZ, input, sizeof(input)); - sendSz = RECORD_HEADER_SZ + sizeof(input); + XMEMCPY(output + RECORD_HEADER_SZ, input, ALERT_SIZE); + sendSz = RECORD_HEADER_SZ + ALERT_SIZE; } #ifdef CYASSL_CALLBACKS