Fix OCSP_RESPID processing bug introduced by WPACKET changes
[openssl.git] / ssl / t1_lib.c
index 696998fe5eab030382a435f4a17713b126e14c32..4f5ea42b5a14b69e2c9fdba888951c4979b608f3 100644 (file)
@@ -1209,7 +1209,7 @@ int ssl_add_clienthello_tlsext(SSL *s, WPACKET *pkt, int *al)
             idlen = i2d_OCSP_RESPID(id, NULL);
             if (idlen <= 0
                        /* Sub-packet for an individual id */
-                    || !WPACKET_sub_allocate_bytes_u8(pkt, idlen, &idbytes)
+                    || !WPACKET_sub_allocate_bytes_u16(pkt, idlen, &idbytes)
                     || i2d_OCSP_RESPID(id, &idbytes) != idlen) {
                 SSLerr(SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT, ERR_R_INTERNAL_ERROR);
                 return 0;