Skip to content

object-file: use size_t for object size in check_object_signature() - #6415

Open
i80487 wants to merge 1 commit into
git-for-windows:mainfrom
i80487:fix/change-unsigned-long-to-size-t
Open

i80487 wants to merge 1 commit into
git-for-windows:mainfrom
i80487:fix/change-unsigned-long-to-size-t

Conversation

@i80487

@i80487 i80487 commented Sep 15, 2026

Copy link
Copy Markdown

check_object_signature() function prototype defines size parameter as an unsigned long. However, it receives size as size_t from its current callers and forwards it unchanged to hash_object_file(), which expects size_t. Using size_t here keeps the types consistent and avoids an implicit narrowing conversion to unsigned long, which may truncate values when size >= 2^32 on Windows (an unsigned long is 32-bit while a size_t is 64-bit).

Signed-off-by: David PRUDHOMME <david7.prudhomme@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant