diff --git a/src/shrpx_ssl.cc b/src/shrpx_ssl.cc index 9e18217b..03e1c1bd 100644 --- a/src/shrpx_ssl.cc +++ b/src/shrpx_ssl.cc @@ -99,6 +99,11 @@ std::vector set_alpn_prefs(const std::vector& protos) len += 1 + n; } + if(len > (1 << 16) - 1) { + LOG(FATAL) << "Too long ALPN identifier list: " << len; + DIE(); + } + auto out = std::vector(len); auto ptr = out.data();