diff options
author | craig.schlenter@chromium.org <craig.schlenter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-16 15:55:27 +0000 |
---|---|---|
committer | craig.schlenter@chromium.org <craig.schlenter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-16 15:55:27 +0000 |
commit | 9229b2de068f352b3d184996206870d1d4ffc2b5 (patch) | |
tree | 1ae9cede9601ef943d6a9deac5679e830b23e255 /chrome/browser/privacy_blacklist | |
parent | 5145ec78b86247f3fe84431dda61d9aa3d4541e6 (diff) | |
download | chromium_src-9229b2de068f352b3d184996206870d1d4ffc2b5.zip chromium_src-9229b2de068f352b3d184996206870d1d4ffc2b5.tar.gz chromium_src-9229b2de068f352b3d184996206870d1d4ffc2b5.tar.bz2 |
Fix a strict-aliasing issue in BlacklistStoreInput::ReadUInt.
Review URL: http://codereview.chromium.org/155622
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20869 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/privacy_blacklist')
-rw-r--r-- | chrome/browser/privacy_blacklist/blacklist_store.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/browser/privacy_blacklist/blacklist_store.cc b/chrome/browser/privacy_blacklist/blacklist_store.cc index bf80669..ba3784d 100644 --- a/chrome/browser/privacy_blacklist/blacklist_store.cc +++ b/chrome/browser/privacy_blacklist/blacklist_store.cc @@ -60,10 +60,10 @@ void BlacklistStoreOutput::StoreEntry(const std::string& pattern, } uint32 BlacklistStoreInput::ReadUInt() { - char buf[sizeof(uint32)]; - if (fread(buf, 1, sizeof(uint32), file_) != sizeof(uint32)) + uint32 buf; + if (fread(&buf, 1, sizeof(uint32), file_) != sizeof(uint32)) return 0; - return *reinterpret_cast<uint32*>(buf); + return buf; } std::string BlacklistStoreInput::ReadString() { |