summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Pierre Habouzit <madcoder@debian.org>2007-12-18 02:39:57 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2007-12-17 21:59:26 -0800
commitf9c5a80cdf2265f2df7712fad9f1fb7ef68b4768 (patch)
tree051fb0c0dff4371f97f8ad9407f9f1fd335b1682
parentMerge branch 'maint' (diff)
downloadtgif-f9c5a80cdf2265f2df7712fad9f1fb7ef68b4768.tar.xz
Fix segfault in diff-delta.c when FLEX_ARRAY is 1
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>
-rw-r--r--diff-delta.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/diff-delta.c b/diff-delta.c
index 9e440a9299..601b49e37f 100644
--- 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;