Increase the upper limit on group name length
authorAnthony Hu <anth_hu@hotmail.com>
Wed, 10 Mar 2021 16:15:57 +0000 (11:15 -0500)
committerTomas Mraz <tomas@openssl.org>
Thu, 11 Mar 2021 19:11:04 +0000 (20:11 +0100)
While all the standardized groups would fit within the old limit,
with the addition of providers, some might want to experiment with
new and unstandardized groups. As such, their names might not fit
within the old limit.

Define it as GROUP_NAME_BUFFER_LENGTH with value 64.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14502)

ssl/t1_lib.c

index 4d66db9f9d48a175398f6323a217a0e6394bdfc0..a389b0feedaa278eba98a2e69af0bcc2217ff627 100644 (file)
@@ -693,7 +693,7 @@ err:
 
 /* TODO(3.0): An arbitrary amount for now. Take another look at this */
 # define MAX_GROUPLIST   40
-
+# define GROUP_NAME_BUFFER_LENGTH 64
 typedef struct {
     SSL_CTX *ctx;
     size_t gidcnt;
@@ -705,7 +705,7 @@ static int gid_cb(const char *elem, int len, void *arg)
     gid_cb_st *garg = arg;
     size_t i;
     uint16_t gid = 0;
-    char etmp[20];
+    char etmp[GROUP_NAME_BUFFER_LENGTH];
 
     if (elem == NULL)
         return 0;