Bug 726417: Signed/unsigned comparison in nsCacheMetaData::UnflattenMetaData r=jduell
authorMs2ger <ms2ger@gmail.com>
Mon, 13 Feb 2012 11:32:31 -0800
changeset 86741 9d8f174bc89d4c030b2d19b3a138eb5267a48c7b
parent 86740 da94847d66d438a964cf5e75a813543a8badbcde
child 86742 108f5491cf3fecd04805b98cbbb7c33c5ed3afb9
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersjduell
bugs726417
milestone13.0a1
Bug 726417: Signed/unsigned comparison in nsCacheMetaData::UnflattenMetaData r=jduell
netwerk/cache/nsCacheMetaData.cpp
--- a/netwerk/cache/nsCacheMetaData.cpp
+++ b/netwerk/cache/nsCacheMetaData.cpp
@@ -136,17 +136,17 @@ nsCacheMetaData::UnflattenMetaData(const
         // Check if the metadata ends with a zero byte.
         if (data[size-1] != '\0') {
             NS_ERROR("Cache MetaData is not null terminated");
             return NS_ERROR_ILLEGAL_VALUE;
         }
         // Check that there are an even number of zero bytes
         // to match the pattern { key \0 value \0 }
         bool odd = false;
-        for (int i = 0; i < size; i++) {
+        for (PRUint32 i = 0; i < size; i++) {
             if (data[i] == '\0') 
                 odd = !odd;
         }
         if (odd) {
             NS_ERROR("Cache MetaData is malformed");
             return NS_ERROR_ILLEGAL_VALUE;
         }