Title: [284962] trunk/Tools
Revision
284962
Author
[email protected]
Date
2021-10-27 15:21:01 -0700 (Wed, 27 Oct 2021)

Log Message

Use correct String constructor in PrivateClickMeasurement.FraudPrevention API test
https://bugs.webkit.org/show_bug.cgi?id=232362

Patch by Alex Christensen <[email protected]> on 2021-10-27
Reviewed by Darin Adler.

The Vector<char> received in the CompletionHandler given to Connection::receiveHTTPRequest is not null terminated,
so we need to call the String constructor that takes a length instead of assuming the byte after the Vector buffer is 0.

* TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm:
(TestWebKitAPI::TEST):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (284961 => 284962)


--- trunk/Tools/ChangeLog	2021-10-27 22:06:51 UTC (rev 284961)
+++ trunk/Tools/ChangeLog	2021-10-27 22:21:01 UTC (rev 284962)
@@ -1,3 +1,16 @@
+2021-10-27  Alex Christensen  <[email protected]>
+
+        Use correct String constructor in PrivateClickMeasurement.FraudPrevention API test
+        https://bugs.webkit.org/show_bug.cgi?id=232362
+
+        Reviewed by Darin Adler.
+
+        The Vector<char> received in the CompletionHandler given to Connection::receiveHTTPRequest is not null terminated,
+        so we need to call the String constructor that takes a length instead of assuming the byte after the Vector buffer is 0.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm:
+        (TestWebKitAPI::TEST):
+
 2021-10-27  Kate Cheney  <[email protected]>
 
         REGRESSION: [iOS] TestWebKitAPI.InAppBrowserPrivacy.AppBoundDomainAllowsServiceWorkers is failing

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm (284961 => 284962)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm	2021-10-27 22:06:51 UTC (rev 284961)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm	2021-10-27 22:21:01 UTC (rev 284962)
@@ -238,7 +238,7 @@
                     connection.receiveHTTPRequest([connection, &rsaPrivateKey, &modulusNBytes, &rng, &keyData, &done, &secKey] (Vector<char>&& request2) {
                         EXPECT_TRUE(strnstr(request2.data(), "POST / HTTP/1.1\r\n", request2.size()));
 
-                        auto request2String = String(request2.data());
+                        auto request2String = String(request2.data(), request2.size());
                         auto key = String("source_unlinkable_token");
                         auto start = request2String.find(key);
                         start += key.length() + 3;
@@ -275,7 +275,7 @@
                                         EXPECT_FALSE(strnstr(request4.data(), token.utf8().data(), request4.size()));
                                         EXPECT_FALSE(strnstr(request4.data(), unlinkableToken.utf8().data(), request4.size()));
 
-                                        auto request4String = String(request4.data());
+                                        auto request4String = String(request4.data(), request4.size());
 
                                         auto key = String("source_secret_token");
                                         auto start = request4String.find(key);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to