summaryrefslogtreecommitdiff
path: root/lib/ext/ecc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ext/ecc.c')
-rw-r--r--lib/ext/ecc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/ext/ecc.c b/lib/ext/ecc.c
index d8cfbeb108..ec9fc25bfb 100644
--- a/lib/ext/ecc.c
+++ b/lib/ext/ecc.c
@@ -220,11 +220,18 @@ _gnutls_supported_ecc_pf_recv_params(gnutls_session_t session,
(GNUTLS_E_RECEIVED_ILLEGAL_EXTENSION);
len = data[0];
+ if (len < 1)
+ return
+ gnutls_assert_val
+ (GNUTLS_E_RECEIVED_ILLEGAL_EXTENSION);
+
DECR_LEN(data_size, len + 1);
for (i = 1; i <= len; i++)
- if (data[i] == 0) /* uncompressed */
+ if (data[i] == 0) { /* uncompressed */
uncompressed = 1;
+ break;
+ }
if (uncompressed == 0)
return