Commit 6d0a39de authored by hbono@chromium.org's avatar hbono@chromium.org

A quick fix for Mac GCC.

This change just uses bit testing so Mac GCC does not complain "comparison is always false due to limited range of data type".

BUG=none
TEST=fix build on the "Webkit Mac (valgrind)" bot

Review URL: http://codereview.chromium.org/8427024

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108091 0039d316-1c4b-4281-b951-d872f2087c98
parent c2ce4631
......@@ -410,7 +410,7 @@ CRLSet::Result CRLSet::CheckCertificate(
const base::StringPiece& parent_spki) const {
base::StringPiece serial(serial_number);
if (!serial.empty() && serial[0] >= 0x80) {
if (!serial.empty() && (serial[0] & 0x80) != 0) {
// This serial number is negative but the process which generates CRL sets
// will reject any certificates with negative serial numbers as invalid.
return UNKNOWN;
......
......@@ -710,7 +710,7 @@ bool X509Certificate::IsBlacklisted() const {
{0x3e,0x75,0xce,0xd4,0x6b,0x69,0x30,0x21,0x21,0x88,0x30,0xae,0x86,0xa8,0x2a,0x71},
};
if (!serial_number_.empty() && serial_number_[0] >= 0x80) {
if (!serial_number_.empty() && (serial_number_[0] & 0x80) != 0) {
// This is a negative serial number, which isn't technically allowed but
// which probably happens. In order to avoid confusing a negative serial
// number with a positive one once the leading zeros have been removed, we
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment