Repository navigation
Sync CodeQL fixes from Android (fastboot, ext4_utils, libfec) - #3630
Merged
Merged
Conversation
Cherry-pick from ag/43929786: GitHub's CodeQL AI detected that this expression might "not be what the programmer intended" due to len and total both being unsigned (size_t), however in practice this code is not buggy, but to avoid the false detection change the check to a much easier to understand expression. Change-Id: Id1b52b9a5979ada7797663447e43daad7cd04637 Assisted-by: Jetski:Gemini
Cherry-pick from ag/43928713: Cast info.block_size to off_t before multiplying by (aux_info.first_data_block + 1) when seeking to the block group descriptors, preventing potential unsigned int overflow. Change-Id: Ieb9c63a9875337f85855785e6f881715e0d39ea8 Assisted-by: Jetski:Gemini
Cherry-pick from ag/43930329: Use uint64_t for block counts and loop indices (j, blocks, hash_data_blocks) in hashtree_info::verify_tree (and update their format specifiers to PRIu64) so multiplications by padded_digest_length_ and FEC_BLOCKSIZE are evaluated in 64-bit arithmetic. Precompute curr_hash_offset, curr_data_offset, and hash_data_size as uint64_t, and check hash_data_size against PTRDIFF_MAX before allocating data_hashes so 32-bit targets return -1 cleanly rather than aborting. Change-Id: If0915d7f64b4af1cc4fc8478b8b13fca01947fc7 Assisted-by: Jetski:Gemini
Databean
approved these changes
Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-picks three CodeQL integer/comparison fixes that have been upstreamed to Android:
fastboot/fastboot_driver.cpp(len - total > 0→total < len).lseekoffset inlibext4_utils/ext4_utils.cppby castinginfo.block_sizetooff_tbefore multiplying by(aux_info.first_data_block + 1).fec/libfec/fec_verity.cppby usinguint64_tfor block counts and loop indices and checkinghash_data_size <= PTRDIFF_MAX.