summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b6c4a48)
raw | patch | inline | side by side (parent: b6c4a48)
author | Dennis Stosberg <dennis@stosberg.net> | |
Sun, 28 May 2006 19:08:08 +0000 (21:08 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 28 May 2006 20:31:50 +0000 (13:31 -0700) |
In the "next" branch, write_index_ext_header() writes garbage on a
64-bit big-endian machine; the written index file will be unreadable.
I noticed this on NetBSD/sparc64. Reproducible with:
$ git init-db
$ :>file
$ git-update-index --add file
$ git-write-tree
$ git-update-index
error: index uses extension, which we do not understand
fatal: index file corrupt
Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
64-bit big-endian machine; the written index file will be unreadable.
I noticed this on NetBSD/sparc64. Reproducible with:
$ git init-db
$ :>file
$ git-update-index --add file
$ git-write-tree
$ git-update-index
error: index uses extension, which we do not understand
fatal: index file corrupt
Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
read-cache.c | patch | blob | history |
diff --git a/read-cache.c b/read-cache.c
index 1f71d125780fbaecf613f8b979fcc04b1b630c97..5270e834dd06974f77f0dcdfbee3eaea64249129 100644 (file)
--- a/read-cache.c
+++ b/read-cache.c
}
static int write_index_ext_header(SHA_CTX *context, int fd,
- unsigned long ext, unsigned long sz)
+ unsigned int ext, unsigned int sz)
{
ext = htonl(ext);
sz = htonl(sz);