Merge branch 'js/check-null-from-read-object-file'
The code paths that call repo_read_object_file() have been tightened to react to errors. * js/check-null-from-read-object-file: Always check the return value of `repo_read_object_file()`
This commit is contained in:
@ -716,9 +716,11 @@ static int append_edit(int argc, const char **argv, const char *prefix)
|
||||
struct strbuf buf = STRBUF_INIT;
|
||||
char *prev_buf = repo_read_object_file(the_repository, note, &type, &size);
|
||||
|
||||
if (prev_buf && size)
|
||||
if (!prev_buf)
|
||||
die(_("unable to read %s"), oid_to_hex(note));
|
||||
if (size)
|
||||
strbuf_add(&buf, prev_buf, size);
|
||||
if (d.buf.len && prev_buf && size)
|
||||
if (d.buf.len && size)
|
||||
append_separator(&buf);
|
||||
strbuf_insert(&d.buf, 0, buf.buf, buf.len);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user