Title: [124441] trunk/Source/WebCore
Revision
124441
Author
[email protected]
Date
2012-08-02 05:03:13 -0700 (Thu, 02 Aug 2012)

Log Message

Alignment issue for readTime in PluginDatabase.cpp
https://bugs.webkit.org/show_bug.cgi?id=92746

Reviewed by Simon Hausmann.

When the byte stream is written, nothing guarantees that
the time_t data is aligned. This issue caused alignment
traps on ARM CPUs.

No new tests. Covered by existing tests.

* plugins/PluginDatabase.cpp:
(WebCore::readTime):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (124440 => 124441)


--- trunk/Source/WebCore/ChangeLog	2012-08-02 12:02:22 UTC (rev 124440)
+++ trunk/Source/WebCore/ChangeLog	2012-08-02 12:03:13 UTC (rev 124441)
@@ -1,3 +1,19 @@
+2012-08-02  Zoltan Herczeg  <[email protected]>
+
+        Alignment issue for readTime in PluginDatabase.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=92746
+
+        Reviewed by Simon Hausmann.
+
+        When the byte stream is written, nothing guarantees that
+        the time_t data is aligned. This issue caused alignment
+        traps on ARM CPUs.
+
+        No new tests. Covered by existing tests.
+
+        * plugins/PluginDatabase.cpp:
+        (WebCore::readTime):
+
 2012-08-02  Tommy Widenflycht  <[email protected]>
 
         MediaStream API: Add RTCPeerConnectionHandler infrastructure

Modified: trunk/Source/WebCore/plugins/PluginDatabase.cpp (124440 => 124441)


--- trunk/Source/WebCore/plugins/PluginDatabase.cpp	2012-08-02 12:02:22 UTC (rev 124440)
+++ trunk/Source/WebCore/plugins/PluginDatabase.cpp	2012-08-02 12:03:13 UTC (rev 124441)
@@ -510,7 +510,8 @@
     if (start + sizeof(time_t) >= end)
         return false;
 
-    resultTime = *reinterpret_cast_ptr<time_t*>(start);
+    // The stream is not necessary aligned.
+    memcpy(&resultTime, start, sizeof(time_t));
     start += sizeof(time_t);
 
     return true;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to