зеркало из https://github.com/mozilla/gecko-dev.git
325765 Cache causes crash crossing architecture [@ nsDiskCacheRecord::HashNumber].[@ nsDiskCacheMap::FindRecord]. Disk cache is not endian-neutral as was intended. Byte-swap the entire cache header. r=darin sr=smfr a/1.8=darin
This commit is contained in:
Родитель
8264c76983
Коммит
60d0a1723e
|
@ -53,7 +53,7 @@
|
|||
class nsDiskCache {
|
||||
public:
|
||||
enum {
|
||||
kCurrentVersion = 0x00010007 // format = 16 bits major version/16 bits minor version
|
||||
kCurrentVersion = 0x00010009 // format = 16 bits major version/16 bits minor version
|
||||
};
|
||||
|
||||
enum { kData, kMetaData };
|
||||
|
|
|
@ -358,6 +358,11 @@ struct nsDiskCacheHeader {
|
|||
mEntryCount = htonl(mEntryCount);
|
||||
mIsDirty = htonl(mIsDirty);
|
||||
mRecordCount = htonl(mRecordCount);
|
||||
|
||||
for (PRUint32 i = 0; i < kBuckets ; i++) {
|
||||
mEvictionRank[i] = htonl(mEvictionRank[i]);
|
||||
mBucketUsage[i] = htonl(mBucketUsage[i]);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -369,6 +374,11 @@ struct nsDiskCacheHeader {
|
|||
mEntryCount = ntohl(mEntryCount);
|
||||
mIsDirty = ntohl(mIsDirty);
|
||||
mRecordCount = ntohl(mRecordCount);
|
||||
|
||||
for (PRUint32 i = 0; i < kBuckets ; i++) {
|
||||
mEvictionRank[i] = ntohl(mEvictionRank[i]);
|
||||
mBucketUsage[i] = ntohl(mBucketUsage[i]);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче