1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

GitFileSystemObjectSink: catch an overflow

This commit is contained in:
Robert Hensing 2024-07-01 17:14:27 +02:00
parent a409c1a882
commit f0329568b5
2 changed files with 22 additions and 0 deletions

View file

@ -931,6 +931,8 @@ struct GitFileSystemObjectSinkImpl : GitFileSystemObjectSink
++dir;
relTargetLeft = relTargetLeft.substr(3);
}
if (dir == pendingDirs.rend())
throw Error("invalid hard link target '%s' for path '%s'", target, path);
// Look up the remainder of the target, starting at the
// top-most `git_treebuilder`.