summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@yahooinc.com>2022-03-24 00:09:38 +0100
committerTor Egge <Tor.Egge@yahooinc.com>2022-03-24 00:09:38 +0100
commitfe1677d61879550806b1737d10d18d22fcbd47dc (patch)
tree30fde791ae6d934eee2ef133b6dd1ad6b2e32ee3 /config
parent73b080b527e303a60a365b2bb95b72dcc2f81f4c (diff)
Avoid signed integer overflow in hashCode() which could trigger undefined
behavior.
Diffstat (limited to 'config')
-rw-r--r--config/src/vespa/config/frt/frtconnectionpool.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/config/src/vespa/config/frt/frtconnectionpool.cpp b/config/src/vespa/config/frt/frtconnectionpool.cpp
index 0c11401e052..916784896ab 100644
--- a/config/src/vespa/config/frt/frtconnectionpool.cpp
+++ b/config/src/vespa/config/frt/frtconnectionpool.cpp
@@ -97,7 +97,7 @@ namespace {
* @return the hash value
*/
int hashCode(const vespalib::string & s) {
- int hashval = 0;
+ unsigned int hashval = 0;
for (int i = 0; i < (int) s.length(); i++) {
hashval = 31 * hashval + s[i];