Open image files in binary mode
This is required for read() to function correctly
in Windows since it behaves differently in text mode and
binary mode and may cause unpredictable behavior depending
on the contents of the image file.
Bug: 129281908
Test: fastboot.exe flashall
Change-Id: I64370af44a050bafea60ff1b0b2be18cc531480a
Merged-In: I64370af44a050bafea60ff1b0b2be18cc531480a
(cherry picked from commit 1a6f6feff4
)
This commit is contained in:
parent
20b0bd9ca4
commit
4113cf749e
1 changed files with 1 additions and 1 deletions
|
@ -1407,7 +1407,7 @@ bool LocalImageSource::ReadFile(const std::string& name, std::vector<char>* out)
|
|||
|
||||
int LocalImageSource::OpenFile(const std::string& name) const {
|
||||
auto path = find_item_given_name(name);
|
||||
return open(path.c_str(), O_RDONLY);
|
||||
return open(path.c_str(), O_RDONLY | O_BINARY);
|
||||
}
|
||||
|
||||
static void do_flashall(const std::string& slot_override, bool skip_secondary, bool wipe) {
|
||||
|
|
Loading…
Reference in a new issue