From b5841cca40a41c4d3042d4392e60ebc3549617db Mon Sep 17 00:00:00 2001 From: Ben Baron Date: Tue, 16 Jan 2024 13:59:42 -0500 Subject: [PATCH] fix: Rare arithmetic overflow crash in MPIHasher --- mParticle-Apple-SDK/Utils/MPIHasher.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mParticle-Apple-SDK/Utils/MPIHasher.swift b/mParticle-Apple-SDK/Utils/MPIHasher.swift index 37281ab3..f12d9aa2 100644 --- a/mParticle-Apple-SDK/Utils/MPIHasher.swift +++ b/mParticle-Apple-SDK/Utils/MPIHasher.swift @@ -30,7 +30,7 @@ import Foundation var hash: Int32 = 0 for byte in dataToHash { - hash = ((hash << 5) &- hash) + Int32(byte); + hash = ((hash << 5) &- hash) &+ Int32(byte); } return String(hash)