Skip to content

Commit 07cc8ec

Browse files
Nathaniel W Filardogitster
authored andcommitted
read_index(): fix reading extension size on BE 64-bit archs
On big endian platforms with 8-byte unsigned long, the code reads the size of the index extension section (which is a 4-byte network byte order integer) incorrectly. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7a51ed6 commit 07cc8ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

read-cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ int read_index_from(struct index_state *istate, const char *path)
10161016
* extension name (4-byte) and section length
10171017
* in 4-byte network byte order.
10181018
*/
1019-
unsigned long extsize;
1019+
uint32_t extsize;
10201020
memcpy(&extsize, (char *)mmap + src_offset + 4, 4);
10211021
extsize = ntohl(extsize);
10221022
if (read_index_extension(istate,

0 commit comments

Comments
 (0)