Bug 923894: Fix comparison of integers of different signs in mozPoisonWriteMac.cpp.
authorJosh Aas <joshmoz@gmail.com>
Mon, 07 Oct 2013 17:12:53 -0500
changeset 163858 908cbc95f1666c6fc946a4681147d47b78fab5b4
parent 163857 4cae3629b4b583cce681d590f1337881380df248
child 163859 a409c116abca814f81cd16bfa6c787c53b2a4436
child 163878 1134b18371d3ddca6111518e4371299261b5abc2
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs923894
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 923894: Fix comparison of integers of different signs in mozPoisonWriteMac.cpp.
xpcom/build/mozPoisonWriteMac.cpp
--- a/xpcom/build/mozPoisonWriteMac.cpp
+++ b/xpcom/build/mozPoisonWriteMac.cpp
@@ -187,17 +187,17 @@ void AbortOnBadWrite(int fd, const void 
     // user (nss) asks it to sync and once when closing the database.
     ScopedFreePtr<void> wbuf2(malloc(count));
     if (!ValidWriteAssert(wbuf2))
         return;
     off_t pos = lseek(fd, 0, SEEK_CUR);
     if (!ValidWriteAssert(pos != -1))
         return;
     ssize_t r = read(fd, wbuf2, count);
-    if (!ValidWriteAssert(r == count))
+    if (!ValidWriteAssert(r == static_cast<ssize_t>(count)))
         return;
     int cmp = memcmp(wbuf, wbuf2, count);
     if (!ValidWriteAssert(cmp == 0))
         return;
     off_t pos2 = lseek(fd, pos, SEEK_SET);
     if (!ValidWriteAssert(pos2 == pos))
         return;
 }