Skip to content
Permalink
Browse files

lfs_deorphan: avoid infinite loop when traversing metadata-pair linke…

…d-list when pair == tail
  • Loading branch information...
avtolstoy committed Sep 3, 2018
1 parent b8250a3 commit ed07f602fbfa5e9bd905829997436c607f10837a
Showing with 5 additions and 0 deletions.
  1. +5 −0 lfs.c
5 lfs.c
@@ -2493,6 +2493,11 @@ int lfs_deorphan(lfs_t *lfs) {
return err;
}

// Avoid infinite loop when tail == pair
if (lfs_paircmp(cwd.pair, cwd.d.tail) == 0) {
return LFS_ERR_CORRUPT;
}

// check head blocks for orphans
if (!(0x80000000 & pdir.d.size)) {
// check if we have a parent

0 comments on commit ed07f60

Please sign in to comment.
You can’t perform that action at this time.