mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-19 01:30:51 +00:00
Check for error calculating the delta base
Don't assume that it's always going to work. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
This commit is contained in:
parent
31bf5f3857
commit
97f40a0d5c
@ -298,6 +298,8 @@ static int packfile_unpack_delta(
|
||||
base_offset = get_delta_base(p, w_curs, curpos, delta_type, obj_offset);
|
||||
if (base_offset == 0)
|
||||
return git__throw(GIT_EOBJCORRUPTED, "Delta offset is zero");
|
||||
if (base_offset < 0)
|
||||
return git__rethrow(base_offset, "Failed to get delta base");
|
||||
|
||||
git_mwindow_close(w_curs);
|
||||
error = git_packfile_unpack(&base, p, &base_offset);
|
||||
|
Loading…
Reference in New Issue
Block a user