Bug 1702600 - Change ToInteger to ToInteger64 in ClientUsageArray::Deserialize; r=#dom-storage a=pascalc
authorJan Varga <jvarga@mozilla.com>
Tue, 07 Jun 2022 10:34:57 +0200
changeset 689937 73e5baa7ca09a57899b89b2945001510868ba36d
parent 689936 ca71db57421e3061584d57efc4010c560955aa81
child 689938 247d3134bbd59e6d4d1f027b5b39cb2fe7ea4ca6
push id16753
push userpchevrel@mozilla.com
push dateFri, 10 Jun 2022 18:05:28 +0000
treeherdermozilla-beta@a44113765f4d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspascalc
bugs1702600
milestone102.0
Bug 1702600 - Change ToInteger to ToInteger64 in ClientUsageArray::Deserialize; r=#dom-storage a=pascalc We use uint64_t for usages internally, but the deserializing function was using ToInteger which can handle only 32bit integers. The problem became more visible after increasing the group limit from 2GB to 10GB, but it was possible to experience the problem even before that because persisted origins are not limited by the group limit.
dom/quota/ActorsParent.cpp
--- a/dom/quota/ActorsParent.cpp
+++ b/dom/quota/ActorsParent.cpp
@@ -7454,17 +7454,17 @@ nsresult ClientUsageArray::Deserialize(c
            .ToRange()) {
     QM_TRY(OkIf(token.Length() >= 2), NS_ERROR_FAILURE);
 
     Client::Type clientType;
     QM_TRY(OkIf(Client::TypeFromPrefix(token.First(), clientType, fallible)),
            NS_ERROR_FAILURE);
 
     nsresult rv;
-    const uint64_t usage = Substring(token, 1).ToInteger(&rv);
+    const uint64_t usage = Substring(token, 1).ToInteger64(&rv);
     QM_TRY(MOZ_TO_RESULT(rv));
 
     ElementAt(clientType) = Some(usage);
   }
 
   return NS_OK;
 }