Commit ebee4d55 by Carlos Martín Nieto Committed by Vicent Marti

pack: return the correct final offset

The callers of git_packfile_unpack() expect the obj_offset argument to
be set to the beginning of the next object. We were mistakenly returning
the the offset of the object's data, which causes the CRC function to
try to use the wrong offset.

Set obj_offset to curpos instead of elem->offset to point to the next
element and bring back expected behaviour.
parent b401dc9e
......@@ -744,7 +744,7 @@ cleanup:
git__free(obj->data);
if (elem)
*obj_offset = elem->offset;
*obj_offset = curpos;
git_array_clear(chain);
return error;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment