diff options
author | Ed Tanous <ed.tanous@intel.com> | 2018-01-31 00:13:38 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2018-02-06 00:56:16 +0300 |
commit | 41ff64d7f1615325cbf04b2249a3e9b06f42e704 (patch) | |
tree | 6cc8ad2d249620506b2672a17d27b473fa78f5be /include/token_authorization_middleware.hpp | |
parent | 93de6dbaaf53c84d427239b704c81091b3329e1a (diff) | |
download | bmcweb-41ff64d7f1615325cbf04b2249a3e9b06f42e704.tar.xz |
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
Diffstat (limited to 'include/token_authorization_middleware.hpp')
-rw-r--r-- | include/token_authorization_middleware.hpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/token_authorization_middleware.hpp b/include/token_authorization_middleware.hpp index bbbaa156eb..809902022f 100644 --- a/include/token_authorization_middleware.hpp +++ b/include/token_authorization_middleware.hpp @@ -138,7 +138,7 @@ class Middleware { 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(); |