Bladeren bron

Fix "Issue 37742 in oss-fuzz: cpp-httplib:server_fuzzer: Timeout in server_fuzzer"

yhirose 4 jaren geleden
bovenliggende
commit
ab477b5631
1 gewijzigde bestanden met toevoegingen van 1 en 2 verwijderingen
  1. 1 2
      httplib.h

+ 1 - 2
httplib.h

@@ -3216,8 +3216,7 @@ bool prepare_content_receiver(T &x, int &status,
     std::string encoding = x.get_header_value("Content-Encoding");
     std::string encoding = x.get_header_value("Content-Encoding");
     std::unique_ptr<decompressor> decompressor;
     std::unique_ptr<decompressor> decompressor;
 
 
-    if (encoding.find("gzip") != std::string::npos ||
-        encoding.find("deflate") != std::string::npos) {
+    if (encoding == "gzip" || encoding == "deflate") {
 #ifdef CPPHTTPLIB_ZLIB_SUPPORT
 #ifdef CPPHTTPLIB_ZLIB_SUPPORT
       decompressor = detail::make_unique<gzip_decompressor>();
       decompressor = detail::make_unique<gzip_decompressor>();
 #else
 #else