mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-11 18:17:54 +00:00
refdb_fs: fail if refcache returns NULL pointer
We usually check entries returned by `git_sortedcache_entry` for NULL pointers. As we have a write lock in `packed_write`, though, it really should not happen that the function returns NULL. Assert that ref is not NULL to silence a Coverity warning.
This commit is contained in:
parent
0b357e2eed
commit
8d3ee96ada
@ -962,6 +962,7 @@ static int packed_write(refdb_fs_backend *backend)
|
|||||||
|
|
||||||
for (i = 0; i < git_sortedcache_entrycount(refcache); ++i) {
|
for (i = 0; i < git_sortedcache_entrycount(refcache); ++i) {
|
||||||
struct packref *ref = git_sortedcache_entry(refcache, i);
|
struct packref *ref = git_sortedcache_entry(refcache, i);
|
||||||
|
assert(ref);
|
||||||
|
|
||||||
if (packed_find_peel(backend, ref) < 0)
|
if (packed_find_peel(backend, ref) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
Loading…
Reference in New Issue
Block a user