From 3b6a07b74537a85e74e9f3fc5eaf2392513a936f Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Thu, 21 Mar 2013 11:56:50 +0100
Subject: [PATCH] Prevented compiler warning on uninitialized end
---
library/ssl_cli.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/library/ssl_cli.c b/library/ssl_cli.c
index 65baef4bb..502a61ad8 100644
--- a/library/ssl_cli.c
+++ b/library/ssl_cli.c
@@ -774,6 +774,9 @@ static int ssl_parse_server_key_exchange( ssl_context *ssl )
SSL_DEBUG_BUF( 3, "server key exchange", ssl->in_msg + 4, ssl->in_hslen - 4 );
+ p = ssl->in_msg + 4;
+ end = ssl->in_msg + ssl->in_hslen;
+
#if defined(POLARSSL_DHM_C)
if( ciphersuite_info->key_exchange == POLARSSL_KEY_EXCHANGE_DHE_RSA )
{
@@ -786,9 +789,6 @@ static int ssl_parse_server_key_exchange( ssl_context *ssl )
* opaque dh_Ys<1..2^16-1>;
* } ServerDHParams;
*/
- p = ssl->in_msg + 4;
- end = ssl->in_msg + ssl->in_hslen;
-
if( ( ret = dhm_read_params( &ssl->handshake->dhm_ctx, &p, end ) ) != 0 )
{
SSL_DEBUG_MSG( 2, ( "DHM Read Params returned -0x%x", -ret ) );
@@ -811,9 +811,6 @@ static int ssl_parse_server_key_exchange( ssl_context *ssl )
*/
ecdh_init( &ssl->handshake->ecdh_ctx );
- p = ssl->in_msg + 4;
- end = ssl->in_msg + ssl->in_hslen;
-
if( ( ret = ecdh_read_params( &ssl->handshake->ecdh_ctx,
(const unsigned char **) &p, end ) ) != 0 )
{