From 6f7a06222161d246a9efa389045b2f82bfa8847b Mon Sep 17 00:00:00 2001 From: Jiannan Liu <1456542+ljn917@users.noreply.github.com> Date: Mon, 14 Sep 2020 03:11:53 -0400 Subject: [PATCH] Suppress sanitizer warning (#572) Add default initializer for HttpConstraint::method_ member variable to avoid the following warning given by gcc's undefined behavior sanitizer (-fsanitize=undefined): drogon/lib/inc/drogon/utils/HttpConstraint.h:30:7: runtime error: load of value 32767, which is not a valid value for type 'HttpMethod' --- lib/inc/drogon/utils/HttpConstraint.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/inc/drogon/utils/HttpConstraint.h b/lib/inc/drogon/utils/HttpConstraint.h index c2c7bb5a..c1af00f4 100644 --- a/lib/inc/drogon/utils/HttpConstraint.h +++ b/lib/inc/drogon/utils/HttpConstraint.h @@ -57,7 +57,7 @@ class HttpConstraint private: ConstraintType type_{ConstraintType::None}; - HttpMethod method_; + HttpMethod method_{HttpMethod::Invalid}; std::string filterName_; }; } // namespace internal