Skip to content

Commit 62e4ef8

Browse files
szedergitster
authored andcommitted
line-log: initialize diff queue in process_ranges_ordinary_commit()
process_ranges_ordinary_commit() uses a local diff queue variable, which it leaves uninitialized before passing its address to queue_diffs(). This is not an issue, because at the end of that function the contents of an other diff queue is moved into it by simply overwriting whatever is in there, i.e. without reading any uninitialized memory. Still, seeing the uninitialized diff queue being passed around scared me more than once, so out of caution let's make sure that it's initialized. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 9df27c2 commit 62e4ef8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

line-log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ static int process_ranges_ordinary_commit(struct rev_info *rev, struct commit *c
11821182
struct line_log_data *range)
11831183
{
11841184
struct commit *parent = NULL;
1185-
struct diff_queue_struct queue;
1185+
struct diff_queue_struct queue = DIFF_QUEUE_INIT;
11861186
struct line_log_data *parent_range;
11871187
int changed;
11881188

0 commit comments

Comments
 (0)