diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2023-01-12 01:05:02 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-01-19 13:38:06 -0800 |
commit | 0227130244c007870c106fc613903d078730e45c (patch) | |
tree | bac9f94312dc3c99af326b75e0d07a82e86a9c29 /builtin/commit.c | |
parent | b7b37a33711e64bf580ef3141878b12a36e28833 (diff) |
attr: adjust a mismatched data type
On platforms where `size_t` does not have the same width as `unsigned
long`, passing a pointer to the former when a pointer to the latter is
expected can lead to problems.
Windows and 32-bit Linux are among the affected platforms.
In this instance, we want to store the size of the blob that was read in
that variable. However, `read_blob_data_from_index()` passes that
pointer to `read_object_file()` which expects an `unsigned long *`.
Which means that on affected platforms, the variable is not fully
populated and part of its value is left uninitialized. (On Big-Endian
platforms, this problem would be even worse.)
The consequence is that depending on the uninitialized memory's
contents, we may erroneously reject perfectly fine attributes.
Let's address this by passing a pointer to a variable of the expected
data type.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions