| 1223 | } |
| 1224 | |
| 1225 | int unpack_object_header(struct packed_git *p, |
| 1226 | struct pack_window **w_curs, |
| 1227 | off_t *curpos, |
| 1228 | size_t *sizep) |
| 1229 | { |
| 1230 | unsigned char *base; |
| 1231 | unsigned long left; |
| 1232 | unsigned long used; |
| 1233 | enum object_type type; |
| 1234 | |
| 1235 | /* use_pack() assures us we have [base, base + 20) available |
| 1236 | * as a range that we can look at. (Its actually the hash |
| 1237 | * size that is assured.) With our object header encoding |
| 1238 | * the maximum deflated object size is 2^137, which is just |
| 1239 | * insane, so we know won't exceed what we have been given. |
| 1240 | */ |
| 1241 | base = use_pack(p, w_curs, *curpos, &left); |
| 1242 | used = unpack_object_header_buffer(base, left, &type, sizep); |
| 1243 | if (!used) { |
| 1244 | type = OBJ_BAD; |
| 1245 | } else |
| 1246 | *curpos += used; |
| 1247 | |
| 1248 | return type; |
| 1249 | } |
| 1250 | |
| 1251 | void mark_bad_packed_object(struct packed_git *p, const struct object_id *oid) |
| 1252 | { |
no test coverage detected