Title: [254924] trunk/Source/WebKit
Revision
254924
Author
[email protected]
Date
2020-01-22 08:51:12 -0800 (Wed, 22 Jan 2020)

Log Message

[IPC Hardening] Only process Messages::NetworkProcess messages when sent by the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=206558

Unreviewed post-landing review comments from Darin Adler after r254892.

* Platform/IPC/StringReference.h:
(IPC::operator==):
(IPC::operator!=):
(IPC::StringReference::Hash::equal):
(IPC::StringReference::operator==): Deleted.
(IPC::StringReference::operator!=): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (254923 => 254924)


--- trunk/Source/WebKit/ChangeLog	2020-01-22 15:43:38 UTC (rev 254923)
+++ trunk/Source/WebKit/ChangeLog	2020-01-22 16:51:12 UTC (rev 254924)
@@ -1,3 +1,17 @@
+2020-01-22  Chris Dumez  <[email protected]>
+
+        [IPC Hardening] Only process Messages::NetworkProcess messages when sent by the UIProcess
+        https://bugs.webkit.org/show_bug.cgi?id=206558
+
+        Unreviewed post-landing review comments from Darin Adler after r254892.
+
+        * Platform/IPC/StringReference.h:
+        (IPC::operator==):
+        (IPC::operator!=):
+        (IPC::StringReference::Hash::equal):
+        (IPC::StringReference::operator==): Deleted.
+        (IPC::StringReference::operator!=): Deleted.
+
 2020-01-22  Antti Koivisto  <[email protected]>
 
         [LFC][Integration] Disable integration to see performance impact

Modified: trunk/Source/WebKit/Platform/IPC/StringReference.h (254923 => 254924)


--- trunk/Source/WebKit/Platform/IPC/StringReference.h	2020-01-22 15:43:38 UTC (rev 254923)
+++ trunk/Source/WebKit/Platform/IPC/StringReference.h	2020-01-22 16:51:12 UTC (rev 254924)
@@ -63,22 +63,12 @@
 
     CString toString() const;
 
-    friend bool operator==(const StringReference& a, const StringReference& b)
-    {
-        return a.m_size == b.m_size && !memcmp(a.m_data, b.m_data, a.m_size);
-    }
-
-    friend bool operator!=(const StringReference& a, const StringReference& b)
-    {
-        return !(a == b);
-    }
-
     void encode(Encoder&) const;
     static bool decode(Decoder&, StringReference&);
 
     struct Hash {
         static unsigned hash(const StringReference& a);
-        static bool equal(const StringReference& a, const StringReference& b) { return a == b; }
+        static bool equal(const StringReference&, const StringReference&);
         static const bool safeToCompareToEmptyOrDeleted = true;
     };
 
@@ -87,6 +77,21 @@
     size_t m_size;
 };
 
+inline bool operator==(const StringReference& a, const StringReference& b)
+{
+    return a.size() == b.size() && !memcmp(a.data(), b.data(), a.size());
+}
+
+inline bool operator!=(const StringReference& a, const StringReference& b)
+{
+    return !(a == b);
+}
+
+inline bool StringReference::Hash::equal(const StringReference& a, const StringReference& b)
+{
+    return a == b;
+}
+
 } // namespace IPC
 
 namespace WTF {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to