Fix off by one error in cookie authentication
sizeof(const char*) will include the size of the null terminator at the
end. Fix that.
Change-Id: Ia7c5ce4788bf0d2a5240d9df9684a2d93f791e58
diff --git a/include/token_authorization_middleware.hpp b/include/token_authorization_middleware.hpp
index bbbaa15..8099020 100644
--- a/include/token_authorization_middleware.hpp
+++ b/include/token_authorization_middleware.hpp
@@ -138,7 +138,7 @@
if (start_index == std::string::npos) {
return nullptr;
}
- start_index += sizeof("SESSION=");
+ start_index += sizeof("SESSION=") - 1;
auto end_index = cookie_value.find(";", start_index);
if (end_index == std::string::npos) {
end_index = cookie_value.size();