[webkit-changes] [WebKit/WebKit] 3e904e: Safari's IndexedDB data may not be deserialized co...

Sihui noreply at github.com
Tue Mar 26 14:08:21 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3e904eb895ba87ee9749bee09b52aba51b6f1e02
      https://github.com/WebKit/WebKit/commit/3e904eb895ba87ee9749bee09b52aba51b6f1e02
  Author: Sihui Liu <sihui_liu at apple.com>
  Date:   2024-03-26 (Tue, 26 Mar 2024)

  Changed paths:
    M Source/WebCore/bindings/js/SerializedScriptValue.cpp
    M Source/WebCore/bindings/js/SerializedScriptValue.h

  Log Message:
  -----------
  Safari's IndexedDB data may not be deserialized correctly after system upgrades
https://bugs.webkit.org/show_bug.cgi?id=266806
rdar://120031024

Reviewed by Mark Lam.

To fix rdar://119834827, we introduce version 12.1 to SerializeScriptValue, which changed the terminator of the indexed
property section in array compared to version 12. To make sure deserializer knows to deserialize version 12.1, we encode
the minor version in the highest 8 bits of version number. We keep the lowest 24 bit as major version number for
backward compatibility (the previously stored 32-bit major version number can be intepreted as major version with minor
version 0).

* Source/WebCore/bindings/js/SerializedScriptValue.cpp:
(WebCore::majorVersionFor):
(WebCore::minorVersionFor):
(WebCore::makeVersion):
(WebCore::currentVersion):
(WebCore::CloneSerializer::serialize):
(WebCore::CloneSerializer::CloneSerializer):
(WebCore::CloneDeserializer::deserializeString):
(WebCore::CloneDeserializer::deserialize):
(WebCore::CloneDeserializer::isValid const):
(WebCore::CloneDeserializer::shouldRetryWithVersionUpgrade):
(WebCore::CloneDeserializer::upgradeVersion):
(WebCore::CloneDeserializer::read):
(WebCore::CloneDeserializer::readFile):
(WebCore::CloneDeserializer::readArrayBuffer):
(WebCore::CloneDeserializer::readArrayBufferView):
(WebCore::CloneDeserializer::readImageBitmap):
(WebCore::CloneDeserializer::readTerminal):
(WebCore::CloneDeserializer::version const): Deleted.
(WebCore::SerializedScriptValue::wireFormatVersion): Deleted.
* Source/WebCore/bindings/js/SerializedScriptValue.h:

Originally-landed-as: 272448.79 at safari-7618-branch (7a1bb1aab34a). rdar://124556752
Canonical link: https://commits.webkit.org/276710@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list