Title: [278533] trunk/Source/WebCore
Revision
278533
Author
cdu...@apple.com
Date
2021-06-05 22:27:37 -0700 (Sat, 05 Jun 2021)

Log Message

Fix repeated call to String::utf8() in SQLiteFileSystem::computeHashForFileName()
https://bugs.webkit.org/show_bug.cgi?id=226693

Reviewed by Darin Adler.

* platform/sql/SQLiteFileSystem.cpp:
(WebCore::SQLiteFileSystem::computeHashForFileName):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (278532 => 278533)


--- trunk/Source/WebCore/ChangeLog	2021-06-06 05:25:41 UTC (rev 278532)
+++ trunk/Source/WebCore/ChangeLog	2021-06-06 05:27:37 UTC (rev 278533)
@@ -1,5 +1,15 @@
 2021-06-05  Chris Dumez  <cdu...@apple.com>
 
+        Fix repeated call to String::utf8() in SQLiteFileSystem::computeHashForFileName()
+        https://bugs.webkit.org/show_bug.cgi?id=226693
+
+        Reviewed by Darin Adler.
+
+        * platform/sql/SQLiteFileSystem.cpp:
+        (WebCore::SQLiteFileSystem::computeHashForFileName):
+
+2021-06-05  Chris Dumez  <cdu...@apple.com>
+
         Use `const uint8_t*` type more consistently to store bytes in WebKit
         https://bugs.webkit.org/show_bug.cgi?id=226688
 

Modified: trunk/Source/WebCore/platform/sql/SQLiteFileSystem.cpp (278532 => 278533)


--- trunk/Source/WebCore/platform/sql/SQLiteFileSystem.cpp	2021-06-06 05:25:41 UTC (rev 278532)
+++ trunk/Source/WebCore/platform/sql/SQLiteFileSystem.cpp	2021-06-06 05:27:37 UTC (rev 278533)
@@ -127,7 +127,8 @@
 String SQLiteFileSystem::computeHashForFileName(const String& fileName)
 {
     auto cryptoDigest = PAL::CryptoDigest::create(PAL::CryptoDigest::Algorithm::SHA_256);
-    cryptoDigest->addBytes(fileName.utf8().data(), fileName.utf8().length());
+    auto utf8FileName = fileName.utf8();
+    cryptoDigest->addBytes(utf8FileName.data(), utf8FileName.length());
     auto digest = cryptoDigest->computeHash();
     
     // Convert digest to hex.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to