diff options
author | Junio C Hamano <junkio@cox.net> | 2007-02-15 17:13:15 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-02-15 17:13:15 -0800 |
commit | af99711cd84c30a16450f73dbc21ba9f9f9803e6 (patch) | |
tree | 2e0cbaecae75783e2e15e9f6600c04bd9ce95f0b | |
parent | 78e90f89e39b112af2670516f80586163dcd56ca (diff) | |
parent | efa13f7b7ea1605deab3a6478fa0d0706c828170 (diff) | |
download | git-af99711cd84c30a16450f73dbc21ba9f9f9803e6.tar.gz |
Merge branch 'maint'
* maint:
pretend-sha1: grave bugfix.
-rw-r--r-- | sha1_file.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c index b83f59f383..2c870314d5 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -1545,11 +1545,13 @@ int pretend_sha1_file(void *buf, unsigned long len, const char *type, unsigned c co = &cached_objects[cached_object_nr++]; co->size = len; co->type = strdup(type); + co->buf = xmalloc(len); + memcpy(co->buf, buf, len); hashcpy(co->sha1, sha1); return 0; } -void * read_sha1_file(const unsigned char *sha1, char *type, unsigned long *size) +void *read_sha1_file(const unsigned char *sha1, char *type, unsigned long *size) { unsigned long mapsize; void *map, *buf; |