aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/https/tls/gnutls_priority.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/https/tls/gnutls_priority.c')
-rw-r--r--src/daemon/https/tls/gnutls_priority.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/daemon/https/tls/gnutls_priority.c b/src/daemon/https/tls/gnutls_priority.c
index 709f5515..bbdce41c 100644
--- a/src/daemon/https/tls/gnutls_priority.c
+++ b/src/daemon/https/tls/gnutls_priority.c
@@ -66,22 +66,16 @@ MHD_gnutls_cipher_set_priority (mhd_gtls_session_t session, const int *list)
66 return 0; 66 return 0;
67} 67}
68 68
69inline static int 69static int
70_set_priority (mhd_gtls_priority_st * st, const int *list) 70_set_priority (mhd_gtls_priority_st * st, const int *list)
71{ 71{
72 int num = 0, i; 72 int num = 0;
73 73
74 while (list[num] != 0) 74 while ( (list[num] != 0) &&
75 (num < MAX_ALGOS) )
75 num++; 76 num++;
76 if (num > MAX_ALGOS)
77 num = MAX_ALGOS;
78 st->num_algorithms = num; 77 st->num_algorithms = num;
79 78 memcpy(st->priority, list, num * sizeof(int));
80 for (i = 0; i < num; i++)
81 {
82 st->priority[i] = list[i];
83 }
84
85 return 0; 79 return 0;
86} 80}
87 81