diff --git a/src/util.cc b/src/util.cc index e007f5c4..0a6f9d79 100644 --- a/src/util.cc +++ b/src/util.cc @@ -765,7 +765,7 @@ bool select_h2(const unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, const char *key, unsigned int keylen) { for (auto p = in, end = in + inlen; p + keylen <= end; p += *p + 1) { - if (memcmp(key, p, keylen) == 0) { + if (std::equal(key, key + keylen, p)) { *out = p + 1; *outlen = *p; return true;