Loading fastboot/fastboot.cpp +5 −1 Original line number Original line Diff line number Diff line Loading @@ -693,10 +693,14 @@ static void queue_info_dump() { fb_queue_notice("--------------------------------------------"); fb_queue_notice("--------------------------------------------"); } } static struct sparse_file** load_sparse_files(int fd, int max_size) { static struct sparse_file** load_sparse_files(int fd, int64_t max_size) { struct sparse_file* s = sparse_file_import_auto(fd, false, true); struct sparse_file* s = sparse_file_import_auto(fd, false, true); if (!s) die("cannot sparse read file"); if (!s) die("cannot sparse read file"); if (max_size <= 0 || max_size > std::numeric_limits<uint32_t>::max()) { die("invalid max size %" PRId64, max_size); } int files = sparse_file_resparse(s, max_size, nullptr, 0); int files = sparse_file_resparse(s, max_size, nullptr, 0); if (files < 0) die("Failed to resparse"); if (files < 0) die("Failed to resparse"); Loading fastboot/protocol.cpp +3 −3 Original line number Original line Diff line number Diff line Loading @@ -344,12 +344,12 @@ static int fb_download_data_sparse_flush(Transport* transport) { } } int fb_download_data_sparse(Transport* transport, struct sparse_file* s) { int fb_download_data_sparse(Transport* transport, struct sparse_file* s) { int size = sparse_file_len(s, true, false); int64_t size = sparse_file_len(s, true, false); if (size <= 0) { if (size <= 0 || size > std::numeric_limits<uint32_t>::max()) { return -1; return -1; } } std::string cmd(android::base::StringPrintf("download:%08x", size)); std::string cmd(android::base::StringPrintf("download:%08" PRIx64, size)); int r = _command_start(transport, cmd, size, 0); int r = _command_start(transport, cmd, size, 0); if (r < 0) { if (r < 0) { return -1; return -1; Loading Loading
fastboot/fastboot.cpp +5 −1 Original line number Original line Diff line number Diff line Loading @@ -693,10 +693,14 @@ static void queue_info_dump() { fb_queue_notice("--------------------------------------------"); fb_queue_notice("--------------------------------------------"); } } static struct sparse_file** load_sparse_files(int fd, int max_size) { static struct sparse_file** load_sparse_files(int fd, int64_t max_size) { struct sparse_file* s = sparse_file_import_auto(fd, false, true); struct sparse_file* s = sparse_file_import_auto(fd, false, true); if (!s) die("cannot sparse read file"); if (!s) die("cannot sparse read file"); if (max_size <= 0 || max_size > std::numeric_limits<uint32_t>::max()) { die("invalid max size %" PRId64, max_size); } int files = sparse_file_resparse(s, max_size, nullptr, 0); int files = sparse_file_resparse(s, max_size, nullptr, 0); if (files < 0) die("Failed to resparse"); if (files < 0) die("Failed to resparse"); Loading
fastboot/protocol.cpp +3 −3 Original line number Original line Diff line number Diff line Loading @@ -344,12 +344,12 @@ static int fb_download_data_sparse_flush(Transport* transport) { } } int fb_download_data_sparse(Transport* transport, struct sparse_file* s) { int fb_download_data_sparse(Transport* transport, struct sparse_file* s) { int size = sparse_file_len(s, true, false); int64_t size = sparse_file_len(s, true, false); if (size <= 0) { if (size <= 0 || size > std::numeric_limits<uint32_t>::max()) { return -1; return -1; } } std::string cmd(android::base::StringPrintf("download:%08x", size)); std::string cmd(android::base::StringPrintf("download:%08" PRIx64, size)); int r = _command_start(transport, cmd, size, 0); int r = _command_start(transport, cmd, size, 0); if (r < 0) { if (r < 0) { return -1; return -1; Loading