projects
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bd8ff61
)
Fix segfault in diff-delta.c when FLEX_ARRAY is 1
author
Pierre Habouzit
<madcoder@debian.org>
Tue, 18 Dec 2007 01:39:57 +0000
(
02:39
+0100)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 18 Dec 2007 05:59:26 +0000
(21:59 -0800)
aka don't do pointer arithmetics on structs that have a FLEX_ARRAY member,
or you'll end up believing your array is 1 cell off its real address.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff-delta.c
patch
|
blob
|
history
diff --git
a/diff-delta.c
b/diff-delta.c
index 9e440a9299b902bc96749ad2c86c08df6492eb1c..601b49e37f0852abdb8309dbae1ac91ea07f003a 100644
(file)
--- a/
diff-delta.c
+++ b/
diff-delta.c
@@
-264,7
+264,7
@@
struct delta_index * create_delta_index(const void *buf, unsigned long bufsize)
index->src_size = bufsize;
index->hash_mask = hmask;
- mem = index
+ 1
;
+ mem = index
->hash
;
packed_hash = mem;
mem = packed_hash + (hsize+1);
packed_entry = mem;