Commit e06b1040 by Carlos Martín Nieto

Merge pull request #2723 from ravindp/ravindp/fix_4_missing_delta_bases

Fix for misleading "missing delta bases" error.
parents e0482934 ec7e680c
......@@ -671,8 +671,10 @@ static int inject_object(git_indexer *idx, git_oid *id)
seek_back_trailer(idx);
entry_start = idx->pack->mwf.size;
if (git_odb_read(&obj, idx->odb, id) < 0)
if (git_odb_read(&obj, idx->odb, id) < 0) {
giterr_set(GITERR_INDEXER, "missing delta bases");
return -1;
}
data = git_odb_object_data(obj);
len = git_odb_object_size(obj);
......@@ -827,7 +829,6 @@ static int resolve_deltas(git_indexer *idx, git_transfer_progress *stats)
break;
if (!progressed && (fix_thin_pack(idx, stats) < 0)) {
giterr_set(GITERR_INDEXER, "missing delta bases");
return -1;
}
}
......
......@@ -408,11 +408,14 @@ static int packfile_unpack_header1(
size = c & 15;
shift = 4;
while (c & 0x80) {
if (len <= used)
if (len <= used) {
giterr_set(GITERR_ODB, "buffer too small");
return GIT_EBUFS;
}
if (bitsizeof(long) <= shift) {
*usedp = 0;
giterr_set(GITERR_ODB, "packfile corrupted");
return -1;
}
......
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