@matheusbsbs / matheus-bagliano / commits / 07cc8ecac0
Fork 0

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>

Nathaniel W Filardo committed Dec 27, 2009 at 01:11 UTC 07cc8ecac0313c571cb9838585b376df86c80563
1 file changed +1 -1
read-cache.c
+1 -1
@@ -1016,7 +1016,7 @@ int read_index_from(struct index_state *istate, const char *path)
1016 * extension name (4-byte) and section length
1017 * in 4-byte network byte order.
1018 */
1019 - unsigned long extsize;
1019 + uint32_t extsize;
1020 memcpy(&extsize, (char *)mmap + src_offset + 4, 4);
1021 extsize = ntohl(extsize);
1022 if (read_index_extension(istate,