arthurscchan commented on code in PR #13827:
URL: https://github.com/apache/trafficserver/pull/13827#discussion_r4280895540


##########
tests/fuzzing/fuzz_http_compat.cc:
##########
@@ -0,0 +1,110 @@
+#include "proxy/hdrs/HTTP.h"
+#include "proxy/hdrs/HttpCompat.h"
+#include "tscore/Diags.h"
+#include "tsutil/PostScript.h"
+
+#include <array>
+#include <cstddef>
+#include <cstdint>
+#include <string>
+#include <string_view>
+
+extern int cmd_disable_pfreelist;
+
+namespace
+{
+constexpr size_t MAX_INPUT_LENGTH = 16 * 1024;
+
+void
+exercise_lists(const std::string &value, const std::string &candidate, uint8_t 
flags, int output_length)
+{
+  StrList               comma_list((flags & 1) != 0);
+  StrList               semicolon_list((flags & 2) != 0);
+  StrList               token_list((flags & 4) != 0);
+  std::array<char, 256> output{};
+  std::array<char, 256> type{};
+  std::array<char, 256> subtype{};
+  int                   matching_length  = 0;
+  int                   matching_index   = 0;
+  int                   value_length     = static_cast<int>(value.size());
+  int                   candidate_length = static_cast<int>(candidate.size());
+  char                  separator        = (flags & 8) != 0 ? ';' : ',';
+  bool                  ignore_wildcards = (flags & 16) != 0;

Review Comment:
   True. Fixed now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to