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'
This commit is contained in:
Jiannan Liu 2020-09-14 03:11:53 -04:00 committed by GitHub
parent a32170b9a3
commit 6f7a062221
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -57,7 +57,7 @@ class HttpConstraint
private:
ConstraintType type_{ConstraintType::None};
HttpMethod method_;
HttpMethod method_{HttpMethod::Invalid};
std::string filterName_;
};
} // namespace internal