Skip to content

Commit 532083f

Browse files
committed
Merge branch 'kl/attr-read-attr-fromindex-msan-workaround'
Code clarification to avoid an appearance of using an uninitialized variable. * kl/attr-read-attr-fromindex-msan-workaround: attr: fix msan issue in read_attr_from_index
2 parents 107ed55 + 34d982c commit 532083f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

attr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,8 @@ static struct attr_stack *read_attr_from_index(struct index_state *istate,
865865
stack = read_attr_from_blob(istate, &istate->cache[sparse_dir_pos]->oid, relative_path, flags);
866866
} else {
867867
buf = read_blob_data_from_index(istate, path, &size);
868-
stack = read_attr_from_buf(buf, size, path, flags);
868+
if (buf)
869+
stack = read_attr_from_buf(buf, size, path, flags);
869870
}
870871
return stack;
871872
}

0 commit comments

Comments
 (0)