Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: chrome/utility/safe_browsing/mac/udif.cc

Issue 2528243002: Fix silent truncations when extracting values from CheckedNumeric (Closed)
Patch Set: compile fix Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/utility/safe_browsing/mac/hfs.cc ('k') | components/webcrypto/algorithms/aes_cbc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/utility/safe_browsing/mac/udif.h" 5 #include "chrome/utility/safe_browsing/mac/udif.h"
6 6
7 #include <CoreFoundation/CoreFoundation.h> 7 #include <CoreFoundation/CoreFoundation.h>
8 #include <bzlib.h> 8 #include <bzlib.h>
9 #include <libkern/OSByteOrder.h> 9 #include <libkern/OSByteOrder.h>
10 #include <uuid/uuid.h> 10 #include <uuid/uuid.h>
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 if (!decompress_read_offset.IsValid()) { 674 if (!decompress_read_offset.IsValid()) {
675 DLOG(ERROR) << "Partition decompress read offset overflows"; 675 DLOG(ERROR) << "Partition decompress read offset overflows";
676 return -1; 676 return -1;
677 } 677 }
678 678
679 if (!chunk_stream_ || chunk != chunk_stream_->chunk()) { 679 if (!chunk_stream_ || chunk != chunk_stream_->chunk()) {
680 chunk_stream_.reset( 680 chunk_stream_.reset(
681 new UDIFBlockChunkReadStream(stream_, block_size_, chunk)); 681 new UDIFBlockChunkReadStream(stream_, block_size_, chunk));
682 } 682 }
683 current_chunk_ = chunk_number; 683 current_chunk_ = chunk_number;
684 if (chunk_stream_->Seek(decompress_read_offset.ValueOrDie(), SEEK_SET) == -1) 684 if (chunk_stream_->Seek(
685 base::ValueOrDieForType<off_t>(decompress_read_offset), SEEK_SET) ==
686 -1)
685 return -1; 687 return -1;
686 688
687 return offset; 689 return offset;
688 } 690 }
689 691
690 UDIFBlockChunkReadStream::UDIFBlockChunkReadStream(ReadStream* stream, 692 UDIFBlockChunkReadStream::UDIFBlockChunkReadStream(ReadStream* stream,
691 uint16_t block_size, 693 uint16_t block_size,
692 const UDIFBlockChunk* chunk) 694 const UDIFBlockChunk* chunk)
693 : stream_(stream), 695 : stream_(stream),
694 chunk_(chunk), 696 chunk_(chunk),
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 << chunk_->compressed_offset; 865 << chunk_->compressed_offset;
864 return false; 866 return false;
865 } 867 }
866 return true; 868 return true;
867 } 869 }
868 870
869 } // namespace 871 } // namespace
870 872
871 } // namespace dmg 873 } // namespace dmg
872 } // namespace safe_browsing 874 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/utility/safe_browsing/mac/hfs.cc ('k') | components/webcrypto/algorithms/aes_cbc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698