<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - CheckedArithmetic's operator bool() and operator==() is broken."
href="https://bugs.webkit.org/show_bug.cgi?id=146129">146129</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>CheckedArithmetic's operator bool() and operator==() is broken.
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>Product</th>
<td>WebKit
</td>
</tr>
<tr>
<th>Version</th>
<td>528+ (Nightly build)
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>OS</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>Normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P2
</td>
</tr>
<tr>
<th>Component</th>
<td>Web Template Framework
</td>
</tr>
<tr>
<th>Assignee</th>
<td>webkit-unassigned@lists.webkit.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mark.lam@apple.com
</td>
</tr></table>
<p>
<div>
<pre>The existing operator UnspecifiedBoolType*() in CheckedArithmetic is erroneously allowing the Checked value to be implicitly casted into any integer and pointer types. This is because it is doing a reinterpret_cast<UnspecifiedBoolType*>(1) whereas the idiom relies on the cast of a member e.g. reinterpret_cast<UnspecifiedBoolType*>(&Checked::m_value). As a result, ImageBufferData::putData() was getting an implicit cast of a Checked value to 1.
Also, 2 of CheckedArithmetic's operator==() will crash if used on an overflowed value, while a 3rd one does not. The 3rd one should be consistent and also crash if used on an overflowed Checked value.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>