commit | af4a0e846e832a2b5729a8439e3671075901308a | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Wed Nov 14 06:57:46 2018 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Wed Nov 14 06:57:46 2018 +0000 |
tree | ab64da0d1ed9ebedfd815c88f401475603d564b7 | |
parent | 0d700897c4a599d22d6aef8db3722fc3ce0c995f [diff] | |
parent | 27a34d71c175c306d9167f77a5c93716d6db37b7 [diff] |
Merge "liblp: SparseBuilder: num_blocks aren't check correctly"
diff --git a/fs_mgr/liblp/images.cpp b/fs_mgr/liblp/images.cpp index a976643..a46836e 100644 --- a/fs_mgr/liblp/images.cpp +++ b/fs_mgr/liblp/images.cpp
@@ -120,7 +120,7 @@ return; } - uint64_t num_blocks = total_size % block_size; + uint64_t num_blocks = total_size / block_size; if (num_blocks >= UINT_MAX) { // libsparse counts blocks in unsigned 32-bit integers, so we check to // make sure we're not going to overflow.