mirror of
https://github.com/git/git.git
synced 2024-11-24 10:26:17 +08:00
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 <gitster@pobox.com>
This commit is contained in:
parent
7a51ed66f6
commit
07cc8ecac0
@ -1016,7 +1016,7 @@ int read_index_from(struct index_state *istate, const char *path)
|
||||
* extension name (4-byte) and section length
|
||||
* in 4-byte network byte order.
|
||||
*/
|
||||
unsigned long extsize;
|
||||
uint32_t extsize;
|
||||
memcpy(&extsize, (char *)mmap + src_offset + 4, 4);
|
||||
extsize = ntohl(extsize);
|
||||
if (read_index_extension(istate,
|
||||
|
Loading…
Reference in New Issue
Block a user