summaryrefslogtreecommitdiff
path: root/commit-graph.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-12-22 08:24:30 +0100
committerJunio C Hamano <gitster@pobox.com>2024-12-22 00:58:23 -0800
commit2d3cb4b4b5401e2fd5a40600277f424032fc72f0 (patch)
treea774b7a09609d0a84700f78c39d026ac569a74cd /commit-graph.c
parent5ab83521cfe687e4295f5748f2c5d2aa7477efe5 (diff)
reftable/stack: fix zero-sized allocation when there are no readers
Similar as the preceding commit, we may try to do a zero-sized allocation when reloading a reftable stack that ain't got any tables. It is implementation-defined whether malloc(3p) returns a NULL pointer in that case or a zero-sized object. In case it does return a NULL pointer though it causes us to think we have run into an out-of-memory situation, and thus we return an error. Fix this by only allocating arrays when they have at least one entry. Reported-by: Randall S. Becker <rsbecker@nexbridge.com> Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.c')
0 files changed, 0 insertions, 0 deletions