1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 06:01:48 +02:00

libfetchers/git: use unique_ptr::get() instead of operator*()

According to N4950 20.3.1.3.5 [unique.ptr.single.observers]/1,
the behavior is undefined if get() == nullptr. Use get() instead of
operator*() on a possibly-null unique_ptr.

Fixes #10123.
This commit is contained in:
Ivan Shapovalov 2024-03-05 03:49:51 +01:00
parent edcb3430ef
commit 651e62781f

View file

@ -590,7 +590,7 @@ struct GitInputAccessor : InputAccessor
i = lookupCache.emplace(path, std::move(entry)).first;
}
return &*i->second;
return i->second.get();
}
git_tree_entry * need(const CanonPath & path)