Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2023-07-13 02:38:16 +0300
committerJunio C Hamano <gitster@pobox.com>2023-07-14 19:32:03 +0300
commit588af1bfd3c810e02df1d8adc37e9c43a7f97920 (patch)
treec9b4a44a73167e89bfd1b704ccad470dcc5f78f5 /commit-graph.c
parentd76e0a744d3a8c1713f0e913325cab7da92f01ef (diff)
commit-graph.c: prevent overflow in `write_commit_graph()`
In a similar spirit as previous commits, ensure that we don't overflow when trying to read an existing OID while writing a new commit-graph. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.c')
-rw-r--r--commit-graph.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commit-graph.c b/commit-graph.c
index 8333ce8e04..54697e7a4d 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -2454,7 +2454,7 @@ int write_commit_graph(struct object_directory *odb,
struct commit_graph *g = ctx->r->objects->commit_graph;
for (i = 0; i < g->num_commits; i++) {
struct object_id oid;
- oidread(&oid, g->chunk_oid_lookup + g->hash_len * i);
+ oidread(&oid, g->chunk_oid_lookup + st_mult(g->hash_len, i));
oid_array_append(&ctx->oids, &oid);
}
}